Skip to main content
The DeepMask API lets you call DeepMask models from your own apps, scripts, and services. It is OpenAI-compatible, so you can use the official OpenAI SDKs by changing the base URL and API key. Organization admins create keys, choose which models each key can use, and manage billing on the API settings page.

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, and tool roles. Use system instead of developer.
  • In system and user messages, content can be a string or an array of content parts. In assistant and tool messages, content must be a string. An assistant message with tool calls can have null as its content. 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 in user messages 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, and n (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, and reasoning_effort, with a 400 error. A value outside a field’s range, such as n above 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 to https://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 the model 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.