Reselling ai.ml
Run your own storefront on ai.ml: your name and domain, your customers, your prices.
A reseller organization sells ai.ml to its own customers. The customers sign up on your storefront, under your name and on your domain, and pay your prices. You decide who can join, what each customer pays, and who on your team manages what. To turn an organization into a reseller, ask support: it is a commercial agreement, and it sets your revenue share.
Everything here is in the console under Reseller, and in the API reference. These routes use the console session only, not API keys: moving money and admitting customers are things a person does.
Customers
A customer is an organization of its own: its own keys, members, projects and invoices. It has one of two ways to pay:
- Independent. It tops up from its own card or UPI mandate. You earn your revenue share on what it spends, at list price.
- Shared. It spends credit that you move to it from your balance (Allocate credit). It earns you no revenue share, since you paid for the credit.
Customers' API keys carry your key label (acme-live-…), not ai.ml's.
Prices: tiers
A tier is a retail markup on the platform's list price, from 0 to 200 %. Put a customer on a tier and every request it makes is priced at list price plus your markup. The same markup applies to the hold taken before a request, to the progress checks on a long stream, and to the cost on the response. Each cost line is worked out once from the exact product and rounded once, so a markup never compounds a rounding.
The markup is yours. Every hour ai.ml credits your balance with the markup your customers paid in the previous hour, together with your revenue share on independent customers' list-price spend. Your customers' own ledgers show what they paid, not your markup.
Price books
A tier's prices are a price book: your markup on the list price, with its own markup for any model you price separately. A book is a dated version. It is prepared, approved, takes effect at the time the approval sets, and never changes afterwards. Every request is priced by the book in force when it started, so a change never reaches a request already priced, and yesterday's charges stay as they were.
Creating a tier writes its first book, in force at once. After that, a tier's prices change only through a new book: Rename on a tier changes its name and nothing else.
In Reseller → Tiers, press Prices on a tier. The drawer lists every version with its state (draft, waiting for approval, scheduled, in force, superseded, rejected or cancelled), its markup, its models, and when it was in force.
- Change prices starts a draft copied from the prices in force. Set the markup, add a model with Add model and give it its own markup, and write a note. The editor shows the list price per million tokens beside what your customers will pay. Save draft keeps it; Submit for approval sends it. A tier has one book in preparation at a time.
- A submitted book is approved with Approve, choosing when it takes effect: at least fifteen minutes from now, in your time zone, the earliest by default. Reject needs a note saying why. Withdraw takes it back to a draft.
- A second person approves. Whoever submitted a book can approve it only when your organization has no other owner or admin; otherwise the approval is refused with "A second person approves a price book".
- Cancel drops a draft, a book waiting for approval, or an approved book that has not taken effect yet. The tier row says when the next book takes effect.
Preparing, submitting, withdrawing and cancelling a book need the Storefront module. Approving and rejecting, which decide what your customers pay, need the Customers module. Owners and admins have both.
A markup is always on the platform's list price and cannot be negative, so no model can be sold below what the platform charges for it. Because it is a markup and not a fixed price, your price follows the list price when that changes.
You can price only models your organization is entitled to sell. If the platform has limited the models available to you, a model outside that set is refused with model_not_entitled, and your customers cannot call it either.
A customer paying with its own provider key pays only the platform fee, with no markup.
Correcting a price
If a book charged too much, correct it. In the tier's Prices, press Correct past prices on the version that charged it. The correction starts as a copy of that version: lower the markups that were wrong, set the window to correct (Correct from and Correct until, inside the time that version was in force, and no more than a year back), and write a note. The note is shown to each customer beside the credit. A correction can only lower prices.
Submit and approve it as any book. Once its window has closed, every request that version priced in the window is rated again at the corrected prices, and each customer is credited the difference. You pay the credits from your balance; if it does not hold enough, the correction waits and is applied once you add credit.
Reseller → Corrections lists every correction: its window, reason, state and what it credited. Open one to see each customer's requests and credit.
Margins
Reseller → Margins shows, for a month, what your customers paid for their requests and what you earned on it: your markup and your revenue share or partner discount. Show it by customer or by model. The figures come from the requests as rated, so they follow any correction, and appear a few minutes after the requests are made.
Settlement
The Settlement tab is your account with us as a partner.
- Your tier. If you are on a partner tier, it names the tier, the discount it gives on list prices, and what it includes: your own domains and sending address (white label), invoicing your customers yourself, and priority support. A feature your tier does not include is refused with
feature_not_in_tier. A partner on no tier keeps its own domains and its own invoicing, without priority support. - Margin and payouts. The margin you earn is credited to your balance every hour. You can spend it, use it to fund customers, or take it out: enter an amount (at least $50, at most what you have earned and not yet taken out) and press Request payout. The amount leaves your balance at once; our finance team approves it and pays it to your bank, and the payout's row shows the payment reference. A rejected payout goes back to your balance.
- Security. Your agreement may require a security deposit or a bank guarantee. A deposit is moved from your paid balance by our finance team; a guarantee is recorded by its reference, amount and expiry. Until it is in place you cannot add customers or take a payout (
402 partner_security_required). - Monthly statement. Choose a month to see the margin credited, the payouts, and what each customer paid with what you earned on it. Download CSV gives one row per customer; Download PDF the statement. It is not a tax invoice.
Your storefront
Reseller → Storefront sets:
- your name, logo and brand colour;
- your support e-mail and pages;
- your display currency and language;
- who can sign up: anyone, only with an invite you send, or nobody;
- the default tier new customers start on;
- the websites your customers' keys work from (see below).
Your domain
Your domain serves everything your customers use: the console at its root, the API under /v1, and sign-in. Your customers never see an ai.ml address.
- Add the domain under Domains, for example
ai.yourcompany.com. - The domain lists the two records to add, each with its type, name and value and a Copy button: a CNAME to
customers.ai.ml, and a TXT record carrying a token that proves the domain is yours. Names are shown as DNS providers ask for them (aiforai.yourcompany.com), with the full name beneath. - Add both records at your DNS provider. When the console can tell who that is, it says so, and for Cloudflare it gives the steps. On Cloudflare, set the CNAME to DNS only (grey cloud). If your provider supports one-step setup, the domain shows Add the records with your provider instead: sign in there, approve, and you come back to the console, which verifies the domain for you. One-step setup needs a subdomain such as
ai.yourcompany.com. - Press Verify. New records can take a few minutes to be seen: if the TXT record is not found yet, wait a minute and press it again.
Once the domain is verified, the TXT record is no longer needed; keep the CNAME, which routes the domain. A certificate is issued for it, which usually takes a few minutes; the domain reads issuing certificate until then. When it is live, the domain shows your customers' API base URL, https://<your domain>/v1, which they use in place of ai.ml's in any OpenAI- or Anthropic-compatible SDK. If the certificate cannot be issued, the domain says why: fix the CNAME, then press Verify again.
The console on your domain carries your name and logo, signs people in and keeps them there, and sign-ups become your customers on your default tier. A domain belongs to one reseller only, so nobody else can register one you added, even before you verify it.
Your account can have one domain. Domains shows how many you are using. To use a different one, remove the current domain first; to have more than one, contact support.
Your documentation
A domain whose name starts with docs., for example docs.yourcompany.com, serves the API documentation under your name instead of the console. Add it under Domains like any other: it is marked docs site, needs the same two records, is verified the same way and counts towards your domains. Once it is live, the domain links to it.
On that domain every page carries your name, logo and colour. Examples and snippets use your API base URL in place of ai.ml's, and the text names your storefront. The navigation links to your console and your support page or address, and nothing links back to ai.ml. The same holds for the search, the llms.txt and llms-full.txt files that AI tools read, and the API reference, whose Try it panel sends calls to your API. Code names stay as they are: the SDK packages are still called aiml and the CLI @aiml/cli, because that is what your customers install.
Its Console link goes to your console domain when you have one, and the search in your console offers your customers the documentation. A domain that starts with docs. cannot also serve the console.
Where your customers' keys work
A key used from a web page is checked against the page's address. Websites your customers' keys work from sets the rule for all your customers at once. Enter one per line, for example https://app.yourcompany.com, or https://*.yourcompany.com for every subdomain.
With a rule set:
- a browser on any other website is refused with
origin_not_allowed, whatever a customer sets on a key; - a customer's key with no browser origins of its own works from the websites you listed and from your verified domains;
- a customer cannot add a website outside your rule to a key.
Leave it empty for no rule; each key then decides for itself, as it does for anyone else. The rule covers browsers only: a call from a server sends no web page address, so it is not affected. To limit where server calls come from, a key has an IP allow-list.
Your e-mail
The notices your customers receive come from you: a new API key, keys about to expire, an invoice they asked to be sent, a plan that could not be renewed, a webhook endpoint switched off. They carry your storefront's name, link to your domain, and replies go to your support address.
To have them sent from your own domain as well:
- Under E-mail, enter the sending domain, for example
mail.yourcompany.com, and optionally the part before the @ (noreplyby default). - Publish the two records shown: a TXT record for DKIM, and a CNAME for the return path.
- Press Verify.
Until the DKIM record verifies, notices go out from the platform's address under your storefront's name. Once it verifies, they come from your address.
Invites
With sign-up set to invite-only, Invites mints codes. Each code admits as many sign-ups as its uses, for 30 days, and is shown only once. The platform's own invites do not work on your storefront, and yours do not work anywhere else.
Your team
Owners and admins of the reseller organization can do everything. Reseller → Staff grants other members individual modules:
| Module | Lets them |
|---|---|
| View | see customers, tiers, the storefront and usage |
| Customers | create customers, move credit, set tiers, approve price books |
| Storefront | change branding, domains, tiers, announcements and invites; prepare price books |
| Campaigns | fund credit codes from your balance |
| Support | read and answer your customers' tickets |
Talking to your customers
- Announcements appear at the top of every customer's console while they are active.
- Campaigns are batches of up to 1,000 credit codes paid for from your balance. Only your customers can redeem them. Codes nobody redeems come back to your balance when they expire or when you cancel the campaign. A campaign can be funded once your first payment has stood for seven days, and only from paid credit, not from expiring promotional credit.
- Tickets: your customers open tickets from Support in their console. You see them under Reseller → Tickets, and the platform's support team sees them too. See Answering your customers' tickets.
Answering your customers' tickets
Reseller → Tickets lists your customers' tickets, showing the open ones first; the list can also show only those waiting on you, or every ticket. Press a subject to read the whole conversation.
- Reply to the customer: write and press Send reply. The customer reads it under your storefront's name followed by "support", and gets it by email from you. The ticket then waits on the customer; choose and mark resolved or and close beside the button to finish it with the same reply.
- Internal note: tick the box before writing. A note is read by your team and the platform's support team, and never by the customer.
- Status and Priority: change them at the top of the ticket.
The platform's support team can answer on the same ticket. You see their replies and notes with the name of the person who wrote them; your customer sees their replies under your name, as if you had written them. When a customer opens a ticket or replies, your storefront's support address is emailed; without one, your owners and admins are.
Owners and admins can answer tickets. Other members need the Support module under Reseller → Staff.
Invoices
When you fund a customer's balance from your own (Sub-orgs → Allocate), you sold them that credit, so the tax invoice is yours. Under Reseller → Invoicing, save the identity your invoices carry: legal name, address, GSTIN, PAN and state, an LUT number if you invoice customers outside India, and a number series of 2–4 letters and digits. With Issue an invoice in my name on, every allocation issues your tax invoice in the same step: CGST and SGST or IGST by your state and the customer's, numbered in your series (ACME/26-27/00001), in the customer's currency at the day's rate. Your customers see it under Invoices in their console; you see every one under Invoices issued in your name, with its PDF.
These are your supplies under your GSTIN: file them in your own GST returns. If a B2B invoice of yours needs an e-invoice IRN, generate it through your own GSP; the platform does not e-invoice documents it did not supply. To correct one, issue your own credit note: the platform's correction tools do not change documents in your name.
A customer who tops up their own balance pays the platform, so their tax invoice is the platform's, as the law requires. It names you as the provider they buy through, with your support address. If you collect your customers' payments yourself (below), they pay you instead and every invoice is yours.
Outside India
Set Country to where your business is registered. Outside India the GSTIN fields give way to your own tax: its Tax name as it prints (VAT, sales tax), the Rate (%), your Tax registration number, whether My prices include this tax, and whether to Charge no tax to customers in other countries (reverse charge). Your invoices then carry that tax as one line, rounded once: added to the price, or, when your prices include it, worked out of the total. A customer in another country gets a zero-rated invoice with a reverse-charge note when you ask for it.
Payments from your customers
You can take your customers' payments yourself, on your own Stripe or Razorpay account, in your currency and with your tax. The money is yours from the start. When a customer pays, the platform moves the credit they bought from your prepaid balance to them and issues your tax invoice for it, in one step. The platform charges no payment fee of its own on these; you may add a surcharge (up to 10%) that shows as its own line.
Set it up under Reseller → Payments from customers:
- Save your invoicing identity under Invoicing and turn on Issue an invoice in my name. Collecting needs it, because every payment gets your tax invoice.
- Under Your gateways, copy the webhook address shown for the gateway and add it as a webhook in that gateway's dashboard. For Stripe, send the events
checkout.session.completedandcheckout.session.async_payment_succeeded; for Razorpay,payment_link.paid. The address is your own, and only your signing secret is accepted on it. - Press Connect and enter the keys: for Stripe a secret key (a restricted key works) and the webhook signing secret; for Razorpay the key id, key secret and webhook secret. Choose the Settlement currency your customers pay in (Razorpay collects rupees). The keys are checked with the gateway before they are saved, stored sealed, and never shown again: the screen shows only the start and the last four characters. Replace keys swaps them, Test asks the gateway again, and Remove deletes them. The last gateway cannot be removed while collecting is on.
- Turn on Take payments from my customers on my own gateway and press Save. The screen lists anything still missing.
Your customers then see your currency, your tax and your name on their Top up panel, and pay on your checkout. Customers in India pay through Razorpay when you have connected it, everyone else through Stripe. Prices convert from dollars at the platform's booked rate for the day, rounded once.
When your balance is short. The payment is received, so nothing is lost: it waits, your owners and admins get one e-mail saying so, and your customer sees Payment received, credit pending. Add credit to your balance and the waiting payments are booked within a minute, oldest first, each with its invoice. The screen shows how many wait and what they are worth, and Payments from your customers lists every payment with its status.
Refunds are yours. The platform does not refund these payments: refund your customer in your own gateway. A refund there does not take back the credit you moved; if it should, ask support, and the credit is adjusted by hand.
A customer of a reseller that does not collect keeps paying the platform as before.
What is not white-labelled yet
- The sign-in page is the platform's identity provider, and the address bar shows it while your customer signs in.
- API response headers keep their
x-aiml-names. - Package and command names in the documentation stay
aiml, and links to the platform's own website, such as its legal pages, still go there. - Legal notices about the platform's sub-processors come from the platform, because they are the platform's statements as the processor.