Who can use the API
To open the API page, click your name at the bottom of the chat sidebar, choose User Settings, and click API in the settings sidebar. Only organization admins see API.
Keys work only while your organization has an active paid Chat plan and API billing is active. If an API invoice payment fails, requests stop until you pay it. See Billing.
What you can do
- Messages can use the
system,user,assistant, andtoolroles. Usesysteminstead ofdeveloper. - In
systemandusermessages,contentcan be a string or an array of content parts. Inassistantandtoolmessages,contentmust be a string. An assistant message with tool calls can havenullas itscontent. The API refuses file, audio, and document parts. See Messages for the rules for each role. - On seven models, including
gpt-4o, you can send images inusermessages as base64 data URLs. The API refuses image links and never fetches them. See Image input for the models, formats, and limits. - The API accepts a fixed set of request fields. These include the sampling options
temperature,top_p,presence_penalty,frequency_penalty,seed,stop, andn(only as 1). Some models ignore some of these options without an error. See Options that some models ignore. - The API refuses other fields, such as
response_format,logprobs, andreasoning_effort, with a400error. A value outside a field’s range, such asnabove 1, gets the same error. See Request body for the supported fields and their ranges. - Your organization’s Requests per minute, Tokens per minute, and Concurrent requests limits apply to all keys together. Admins see the current values under API limits on the Usage tab. Each key also has its own limits on requests per minute and requests in flight. Requests above a limit are refused with
429. See Limits and fair use for every limit and how fair use works.
Only these two endpoints are available. Embeddings, image generation, legacy completions, the Responses API, and retrieving a single model with
client.models.retrieve() don’t work.Base URL and authentication
Send every request tohttps://api.deepmask.io/v1. You can copy it from Base URL at the top of the API settings page.
Send your key in the Authorization header as Bearer <key>. Keys start with sk- followed by 64 hexadecimal characters. DeepMask shows the full key only once, when you create it.
In the OpenAI SDKs, set base_url (Python) or baseURL (Node.js) to https://api.deepmask.io/v1. Pass your key as api_key or apiKey, and the SDK sends the header for you.
Get started
An admin opens the API settings page, clicks Enable API billing on the page’s Billing tab, and completes checkout. Checkout asks for a payment method and a billing address. The admin then clicks Create key on the Keys tab. Create key stays unavailable until API billing is active. The Quickstart walks you through setup and your first request with cURL, Python, and Node.js.Models and hosting
The API offers chat models from Anthropic, OpenAI, Mistral AI, and other makers. Every API model is hosted in the EU. The Models tab shows the current catalog. Each key can use only the models an admin grants to it. Use the API model ID from the Models tab as themodel value, for example gpt-4o. See Models for capabilities and pricing.
Billing at a glance
- Separate from Chat. API billing is its own pay-as-you-go subscription, and turning it on doesn’t change your Chat plan. See Billing.
- Pay per token. You pay for the tokens each request uses, at the rates per 1M tokens shown on the Models tab, which include the 3% fee but not VAT. See How pricing works.
- Monthly invoice. Your monthly invoice includes model costs plus a 3% fee, plus VAT where applicable. See What you pay.
- Failed requests. Requests that DeepMask or the model provider refuses aren’t billed. A request with an unclear outcome, such as a provider timeout, isn’t billed unless usage for it still arrives later. See Are failed requests billed?.
- Spending caps. The Gateway spending cap is the organization-wide monthly cap shared by all keys, and each key can also have its own optional cap. See Spending caps.
Explore the API docs
Quickstart
Enable billing, create a key, and send your first request.
API keys
Create, review, and revoke keys and choose their models.
Spending caps
Limit monthly spend for your organization and for each key.
Usage and logs
Track monthly charges, review requests, and export a CSV.
Billing
Manage API billing, invoices, and cancellation.
Models
Browse API models, model IDs, and how pricing works.
Chat completions
Request format, image input, streaming, and tool calling.
Limits and fair use
Rate, token, and budget limits, and how fair use works.
Errors and retries
Error codes, retries, and whether failed requests are billed.