Enable API billing, create your first API key, and send a chat completion request to DeepMask models from your own code.
This guide takes you from no API access to your first successful request. You enable API billing for your organization, create a key, and call a model with cURL, Python, or Node.js. The DeepMask API is OpenAI-compatible, so you can use the official OpenAI SDKs by setting the base URL and your DeepMask API key. The API supports chat completions (POST /v1/chat/completions) and model listing (GET /v1/models). Other OpenAI endpoints aren’t supported. For example, the Responses API (/v1/responses) returns 404.
New to the DeepMask API? Read the API overview for what the API offers and how it fits alongside your Chat plan.
Before you start
You need:
Admin access to your organization. Only organization admins see API in User Settings. If you’re a member, ask an admin to set up access. See Team management for roles.
An active paid plan. Your organization needs an active Pro, Power, or Enterprise plan. The Free plan, trials, and plans with an overdue payment don’t include API access.
A payment method for API billing. The API is billed separately from your Chat plan, so checkout asks for a payment method and a billing address.
A way to send requests. Use a macOS or Linux terminal with curl, or Python or Node.js with the OpenAI SDK. On Windows, run the cURL commands in WSL or Git Bash.
If your organization isn’t on an eligible plan, the API page shows “API access needs an active paid Chat plan.” Use the Chat billing link in that notice to review your plan.
Set up access and send a test request
1
Open the API settings
At the bottom of the chat sidebar, click your name and choose User Settings. In the settings sidebar, click API.The page shows the Base URL for all requests, https://api.deepmask.io/v1, with a copy button. Below it are the Keys, Models, Usage, and Billing tabs.
2
Enable API billing
Until API billing is active, the page shows “Enable API billing to start using your keys.” and Create key is unavailable.Click Enable API billing in that notice. You can also open the Billing tab, where the API billing card shows Not enabled, and click Enable API billing there.DeepMask opens Stripe Checkout. Add a payment method, check your billing address, and complete checkout. If your organization already has a name and billing address on file, checkout fills them in. You can also add a VAT ID, which is optional. API billing is a pay-as-you-go subscription: your monthly invoice includes model costs plus a 3% fee, plus VAT where applicable. See Billing for details.
Until API billing is enabled, the API page asks you to enable it before you can create keys.
3
Confirm that billing is active
After checkout, you return to the API page, which refreshes automatically. Open the Billing tab and check that the API billing status shows Active.Activation can take a moment. If the status hasn’t changed yet, wait briefly and click Refresh at the top of the page.If you leave checkout before finishing, API billing stays Not enabled. Click Enable API billing to try again.
4
Review the spending cap (optional)
On the Billing tab, the Gateway spending cap is the organization-wide cap shared by all your keys. It starts at €100 of model costs per month, before the 3% fee and tax. It resets at 00:00 UTC on the 1st of each month.To change it, enter an amount up to the maximum shown below the field and click Save cap. You can also give each key its own cap. See Spending caps.
5
Create a key
Open the Keys tab and click Create key. In the Create API key dialog:
Enter a Key name that identifies the app or environment, such as “Production service”.
Optionally, enter a monthly amount in Key spending cap (optional). It can’t be higher than the Gateway spending cap. Leave it empty to rely on the Gateway spending cap only.
Under Model access, keep Choose models and select the models this key can use. Models are grouped by provider, and each group starts collapsed. To follow the examples on this page, search for gpt-4o or expand OpenAI, and select GPT-4o. Or choose All current models to grant every model available today. Models added later aren’t included.
Click Create key.
You can’t change a key’s models after you create it. To grant different models, create a new key. See API keys.
6
Save your key
The Save your API key dialog shows your new key. Click Copy key and store the key somewhere safe, such as your secrets manager or an environment variable.
DeepMask shows the full key only once. If you close the dialog, reload the page, or switch organizations before you copy it, you can’t get it back. If you lose it, revoke the key and create a new one.
7
Test your key
Before you close the dialog, expand Test your key. Set the DEEPMASK_API_KEY environment variable to your key:
export DEEPMASK_API_KEY="sk-..."
To keep the key out of your shell history, run read -rs DEEPMASK_API_KEY && export DEEPMASK_API_KEY instead, then paste the key and press Enter.Click Copy command, then paste the command into the same terminal and run it. The command sends “Hello” to one of the key’s models. A JSON response with a reply means your key works. Test requests are billed like any other request.When you’re done, click I’ve saved it to close the dialog.
Copy your key before you close the dialog, then test it with the ready-made command.
Keep your key on your server. Read it from an environment variable or a secrets manager, and never put it in browser code, mobile apps, or version control.
Make your first request
Send a chat completion to POST /v1/chat/completions. Each example reads your key from DEEPMASK_API_KEY and uses gpt-4o. To use another model, copy its API model ID from the Models tab and make sure your key can use it.To run the SDK examples, install the official openai package:
Python: Run pip install openai. Save the example as quickstart.py and run python quickstart.py.
Node.js: Run npm install openai. Save the example as quickstart.mjs in the same folder and run node quickstart.mjs. The .mjs extension lets the file use import and top-level await.
Run the examples in the same terminal where you set DEEPMASK_API_KEY. In Windows PowerShell, set the variable with $env:DEEPMASK_API_KEY = "sk-..." instead.
curl https://api.deepmask.io/v1/chat/completions \ -H "Authorization: Bearer $DEEPMASK_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o", "messages": [ {"role": "system", "content": "You are a concise assistant."}, {"role": "user", "content": "Explain what an API key is in one sentence."} ], "max_tokens": 200 }'
import osfrom openai import OpenAIclient = OpenAI( base_url="https://api.deepmask.io/v1", api_key=os.environ["DEEPMASK_API_KEY"],)response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": "You are a concise assistant."}, {"role": "user", "content": "Explain what an API key is in one sentence."}, ], max_tokens=200,)print(response.choices[0].message.content)
import OpenAI from "openai";const client = new OpenAI({ baseURL: "https://api.deepmask.io/v1", apiKey: process.env.DEEPMASK_API_KEY,});const response = await client.chat.completions.create({ model: "gpt-4o", messages: [ { role: "system", content: "You are a concise assistant." }, { role: "user", content: "Explain what an API key is in one sentence." }, ], max_tokens: 200,});console.log(response.choices[0].message.content);
The API accepts a fixed set of request fields. max_tokens, used in the examples above, is one of them. Sampling options such as temperature, top_p, stop, and seed are accepted within their ranges. Some models ignore some of these options without an error. Some models refuse certain values, such as a temperature above 1. Other parameters, such as response_format and logprobs, are refused with a 400 error and the code API_REQUEST_UNBOUNDED. So is an n value other than 1. Check Sampling options and Unsupported parameters before you add options.
Read the response
A successful request returns HTTP 200 with a standard chat completion object. This example is abbreviated, and your values will differ:
{ "id": "chatcmpl-...", "object": "chat.completion", "model": "gpt-4o", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "An API key is a secret token that identifies your app when it calls an API." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 27, "completion_tokens": 18, "total_tokens": 45 }}
choices[0].message.content contains the model’s reply.
usage shows the input and output tokens of the request. Requests are billed by token. See Models for how pricing works.
Your request also appears in the Request log on the Usage tab. If you don’t see it yet, click Refresh at the top of the page. See Usage and logs.To receive the reply in pieces as the model writes it, set stream to true. See Chat completions for streaming, tools, and all supported fields.
If your first request fails
Every error returns a JSON body whose error.code names the problem, such as API_MODEL_NOT_ALLOWED. The error.message is always the same, so check the HTTP status and error.code. See Error response format for the full body.
Status
Code
What to check
401
API_CREDENTIAL_INVALID
The key is missing, mistyped, or revoked. Send exactly one Authorization: Bearer <key> header.
403
API_SUBSCRIPTION_INACTIVE
API billing isn’t active, or your organization isn’t on an active paid plan. Check the API billing status on the Billing tab and any notice at the top of the API page.
403
API_MODEL_NOT_ALLOWED
The key can’t use this model. Use the exact API model ID, and make sure the key includes the model.
400
API_REQUEST_INVALID
The body isn’t valid JSON, the Content-Type: application/json header is missing, or model is missing. Check your quoting and headers.
400
API_REQUEST_UNBOUNDED
The request contains a field or value the API doesn’t accept, such as response_format or a temperature above 2.
404
API_ENDPOINT_NOT_FOUND
The path isn’t supported. Check that your base URL is exactly https://api.deepmask.io/v1, and call /v1/chat/completions without a trailing slash. A path outside /v1/ returns 404 with an empty body.
You’ve reached a limit. Most limits are shared by all keys in your organization. Each key also has a few limits of its own. See API limits on the Usage tab and Limits at a glance. API_MODEL_CAPACITY means the model has reached its capacity limit, which all organizations share. Wait briefly and retry, or try another model.
503
API_ADMISSION_UNAVAILABLE
DeepMask can’t take requests for your organization right now. Wait a minute and retry. If it keeps happening, check the notice at the top of the API page. If it says requests are paused, don’t retry in a loop. See When requests are paused.
503, 504
API_INFERENCE_UNAVAILABLE
DeepMask couldn’t get a response from the model. You aren’t billed unless usage for the request still arrives later. Retry with backoff, but don’t resend the request in a loop. More than 20 failures like this in 24 hours pause your organization’s requests. See Unclear outcomes.
To see which models your key can use, call GET /v1/models. It returns only the models granted to that key:
Create keys per app or environment, review their status, and revoke keys you no longer need.
Set spending caps
Control monthly model costs with the organization-wide cap and optional per-key caps.
Chat completions reference
Learn the supported request fields, streaming, tool calling, and response format.
Models and pricing
Browse API models, find their model IDs, and learn how per-token pricing works.
Limits and fair use
Check the rate, token, and budget limits that apply to your requests.
Errors and retries
Understand error codes, which errors to retry, and how to handle refused requests.
Usage and logs
Track monthly charges, check your API limits, and review your requests.
Billing
Understand your monthly API invoice and manage invoices and cancellation.
⌘I
{"docsConfig":{"theme":"luma","$schema":"https://mintlify.com/docs.json","name":"DeepMask","colors":{"primary":"#139058","light":"#cecece","dark":"#252525"},"logo":{"light":"https://mintcdn.com/deepmaskgmbh/wqYs4HgxrHF-vtoI/images/light-theme-logo-B6Sj8q9n.svg?fit=max\u0026auto=format\u0026n=wqYs4HgxrHF-vtoI\u0026q=85\u0026s=b2e82def8bcaaf56f11738b4e22b9748","dark":"https://mintcdn.com/deepmaskgmbh/wqYs4HgxrHF-vtoI/images/dark-theme-logo--PYJYRlW.svg?fit=max\u0026auto=format\u0026n=wqYs4HgxrHF-vtoI\u0026q=85\u0026s=9aa25f507641b624ce8abc85888b8c16"},"favicon":{"light":"https://mintcdn.com/deepmaskgmbh/IMUyo8_jXysaqNdQ/images/Untitleddesign(30).png?fit=max\u0026auto=format\u0026n=IMUyo8_jXysaqNdQ\u0026q=85\u0026s=02005d43e5d29ab31e5fb0bc8f0175d7","dark":"https://mintcdn.com/deepmaskgmbh/IMUyo8_jXysaqNdQ/images/DeepMaskIcononly1025x1025_white.png?fit=max\u0026auto=format\u0026n=IMUyo8_jXysaqNdQ\u0026q=85\u0026s=ab8caac67616c37907783c84cd4cb817"},"navbar":{"primary":{"type":"button","label":"Try DeepMask","href":"https://chat.deepmask.io/"}},"fonts":{"family":"Open Sans"},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","href":"introduction"},{"language":"de","href":"de/introduction"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"deepmaskgmbh","hasAudioNarration":false,"actualSubdomain":"deepmaskgmbh","customDomains":["documentation.deepmask.io"],"gitSource":{"type":"github","owner":"musmani22","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6afb564be59e7a15fc0aa49f","clientVersion":"0.0.4227","searchFilterCounts":[{"language":"en","tag":"Documentation","count":67},{"language":"de","tag":"Dokumentation","count":67},{"language":"en","tag":"Connectors","count":44},{"language":"de","tag":"Konnektoren","count":44},{"language":"en","tag":"Models","count":24},{"language":"de","tag":"Modelle","count":24},{"language":"en","tag":"Outlook","count":16},{"language":"de","tag":"Outlook","count":16},{"language":"en","tag":"API","count":10},{"language":"en","tag":"SharePoint (Enterprise)","count":10},{"language":"de","tag":"API","count":10},{"language":"de","tag":"SharePoint (Enterprise)","count":10},{"language":"en","tag":"Salesforce (Enterprise)","count":9},{"language":"en","tag":"Google \u0026 Others","count":9},{"language":"de","tag":"Salesforce (Enterprise)","count":9},{"language":"de","tag":"Google \u0026 andere","count":9},{"language":"en","tag":"OneDrive (Personal)","count":8},{"language":"de","tag":"OneDrive (Persönlich)","count":8},{"language":"en","tag":"Core Features","count":7},{"language":"de","tag":"Kernfunktionen","count":7}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"api/quickstart","slug":"/api/quickstart","pageMetadata":{"title":"API quickstart","sidebarTitle":"Quickstart","description":"Enable API billing, create your first API key, and send a chat completion request to DeepMask models from your own code.","keywords":["API","quickstart","API key","chat completions","OpenAI-compatible","OpenAI SDK","cURL","Python","Node.js","API billing"],"href":"/api/quickstart"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Enable API billing, create your first API key, and send a chat completion request to DeepMask models from your own code.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Frame,Heading,Info,Note,OptimizedImage,Step,Steps,Table,Tip,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This guide takes you from no API access to your first successful request. You enable API billing for your organization, create a key, and call a model with cURL, Python, or Node.js. The DeepMask API is OpenAI-compatible, so you can use the official OpenAI SDKs by setting the base URL and your DeepMask API key. The API supports chat completions (`,_jsx(_components.code,{children:`POST /v1/chat/completions`}),`) and model listing (`,_jsx(_components.code,{children:`GET /v1/models`}),`). Other OpenAI endpoints aren’t supported. For example, the Responses API (`,_jsx(_components.code,{children:`/v1/responses`}),`) returns `,_jsx(_components.code,{children:`404`}),`.`]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`New to the DeepMask API? Read the `,_jsx(_components.a,{href:`/api/overview`,children:`API overview`}),` for what the API offers and how it fits alongside your Chat plan.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`before-you-start`,children:`Before you start`}),`\n`,_jsx(_components.p,{children:`You need:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Admin access to your organization.`}),` Only organization admins see `,_jsx(_components.strong,{children:`API`}),` in `,_jsx(_components.strong,{children:`User Settings`}),`. If you’re a member, ask an admin to set up access. See `,_jsx(_components.a,{href:`/enterprise/team-management`,children:`Team management`}),` for roles.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`An active paid plan.`}),` Your organization needs an active Pro, Power, or Enterprise plan. The Free plan, trials, and plans with an overdue payment don’t include API access.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A payment method for API billing.`}),` The API is billed separately from your Chat plan, so checkout asks for a payment method and a billing address.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A way to send requests.`}),` Use a macOS or Linux terminal with `,_jsx(_components.code,{children:`curl`}),`, or Python or Node.js with the OpenAI SDK. On Windows, run the cURL commands in WSL or Git Bash.`]}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`If your organization isn’t on an eligible plan, the API page shows “API access needs an active paid Chat plan.” Use the `,_jsx(_components.strong,{children:`Chat billing`}),` link in that notice to review your plan.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`set-up-access-and-send-a-test-request`,children:`Set up access and send a test request`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Open the API settings`,children:[_jsxs(_components.p,{children:[`At the bottom of the chat sidebar, click your name and choose `,_jsx(_components.strong,{children:`User Settings`}),`. In the settings sidebar, click `,_jsx(_components.strong,{children:`API`}),`.`]}),_jsxs(_components.p,{children:[`The page shows the `,_jsx(_components.strong,{children:`Base URL`}),` for all requests, `,_jsx(_components.code,{children:`https://api.deepmask.io/v1`}),`, with a copy button. Below it are the `,_jsx(_components.strong,{children:`Keys`}),`, `,_jsx(_components.strong,{children:`Models`}),`, `,_jsx(_components.strong,{children:`Usage`}),`, and `,_jsx(_components.strong,{children:`Billing`}),` tabs.`]})]}),_jsxs(Step,{title:`Enable API billing`,children:[_jsxs(_components.p,{children:[`Until API billing is active, the page shows “Enable API billing to start using your keys.” and `,_jsx(_components.strong,{children:`Create key`}),` is unavailable.`]}),_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`Enable API billing`}),` in that notice. You can also open the `,_jsx(_components.strong,{children:`Billing`}),` tab, where the `,_jsx(_components.strong,{children:`API billing`}),` card shows `,_jsx(_components.strong,{children:`Not enabled`}),`, and click `,_jsx(_components.strong,{children:`Enable API billing`}),` there.`]}),_jsxs(_components.p,{children:[`DeepMask opens Stripe Checkout. Add a payment method, check your billing address, and complete checkout. If your organization already has a name and billing address on file, checkout fills them in. You can also add a VAT ID, which is optional. API billing is a pay-as-you-go subscription: your monthly invoice includes model costs plus a 3% fee, plus VAT where applicable. See `,_jsx(_components.a,{href:`/api/billing`,children:`Billing`}),` for details.`]}),_jsx(Frame,{caption:`Until API billing is enabled, the API page asks you to enable it before you can create keys.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/enable-billing.jpg?fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=7afe57ef042a7091b168cc228f8e7810`,alt:`API settings page with the notice Enable API billing to start using your keys, an Enable API billing button, the Base URL, and an empty Keys tab.`,\"data-og-width\":`1410`,width:`1410`,\"data-og-height\":`963`,height:`963`,\"data-path\":`images/api/enable-billing.jpg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/enable-billing.jpg?w=280\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=13bc50d3164f4c655f907b17365da441 280w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/enable-billing.jpg?w=560\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=99d9cc4c6f8b9d175c94ec686ce28fda 560w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/enable-billing.jpg?w=840\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=2922306fed4482a50c6bd57ea274380f 840w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/enable-billing.jpg?w=1100\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=fb7d479e7f3c340cc8d0003e6a18486d 1100w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/enable-billing.jpg?w=1650\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=0ec199074097324b3036caf7963171ba 1650w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/enable-billing.jpg?w=2500\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=6eb10745ea744381c56a41b04e7faa64 2500w`})})]}),_jsxs(Step,{title:`Confirm that billing is active`,children:[_jsxs(_components.p,{children:[`After checkout, you return to the API page, which refreshes automatically. Open the `,_jsx(_components.strong,{children:`Billing`}),` tab and check that the `,_jsx(_components.strong,{children:`API billing`}),` status shows `,_jsx(_components.strong,{children:`Active`}),`.`]}),_jsxs(_components.p,{children:[`Activation can take a moment. If the status hasn’t changed yet, wait briefly and click `,_jsx(_components.strong,{children:`Refresh`}),` at the top of the page.`]}),_jsxs(_components.p,{children:[`If you leave checkout before finishing, API billing stays `,_jsx(_components.strong,{children:`Not enabled`}),`. Click `,_jsx(_components.strong,{children:`Enable API billing`}),` to try again.`]})]}),_jsxs(Step,{title:`Review the spending cap (optional)`,children:[_jsxs(_components.p,{children:[`On the `,_jsx(_components.strong,{children:`Billing`}),` tab, the `,_jsx(_components.strong,{children:`Gateway spending cap`}),` is the organization-wide cap shared by all your keys. It starts at €100 of model costs per month, before the 3% fee and tax. It resets at 00:00 UTC on the 1st of each month.`]}),_jsxs(_components.p,{children:[`To change it, enter an amount up to the maximum shown below the field and click `,_jsx(_components.strong,{children:`Save cap`}),`. You can also give each key its own cap. See `,_jsx(_components.a,{href:`/api/spending-caps`,children:`Spending caps`}),`.`]})]}),_jsxs(Step,{title:`Create a key`,children:[_jsxs(_components.p,{children:[`Open the `,_jsx(_components.strong,{children:`Keys`}),` tab and click `,_jsx(_components.strong,{children:`Create key`}),`. In the `,_jsx(_components.strong,{children:`Create API key`}),` dialog:`]}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Enter a `,_jsx(_components.strong,{children:`Key name`}),` that identifies the app or environment, such as “Production service”.`]}),`\n`,_jsxs(_components.li,{children:[`Optionally, enter a monthly amount in `,_jsx(_components.strong,{children:`Key spending cap (optional)`}),`. It can’t be higher than the `,_jsx(_components.strong,{children:`Gateway spending cap`}),`. Leave it empty to rely on the `,_jsx(_components.strong,{children:`Gateway spending cap`}),` only.`]}),`\n`,_jsxs(_components.li,{children:[`Under `,_jsx(_components.strong,{children:`Model access`}),`, keep `,_jsx(_components.strong,{children:`Choose models`}),` and select the models this key can use. Models are grouped by provider, and each group starts collapsed. To follow the examples on this page, search for `,_jsx(_components.code,{children:`gpt-4o`}),` or expand `,_jsx(_components.strong,{children:`OpenAI`}),`, and select GPT-4o. Or choose `,_jsx(_components.strong,{children:`All current models`}),` to grant every model available today. Models added later aren’t included.`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Create key`}),`.`]}),`\n`]}),_jsxs(_components.p,{children:[`You can’t change a key’s models after you create it. To grant different models, create a new key. See `,_jsx(_components.a,{href:`/api/keys`,children:`API keys`}),`.`]})]}),_jsxs(Step,{title:`Save your key`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Save your API key`}),` dialog shows your new key. Click `,_jsx(_components.strong,{children:`Copy key`}),` and store the key somewhere safe, such as your secrets manager or an environment variable.`]}),_jsx(Warning,{children:_jsx(_components.p,{children:`DeepMask shows the full key only once. If you close the dialog, reload the page, or switch organizations before you copy it, you can’t get it back. If you lose it, revoke the key and create a new one.`})})]}),_jsxs(Step,{title:`Test your key`,children:[_jsxs(_components.p,{children:[`Before you close the dialog, expand `,_jsx(_components.strong,{children:`Test your key`}),`. Set the `,_jsx(_components.code,{children:`DEEPMASK_API_KEY`}),` environment variable to your key:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` DEEPMASK_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sk-...\"`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`To keep the key out of your shell history, run `,_jsx(_components.code,{children:`read -rs DEEPMASK_API_KEY \u0026\u0026 export DEEPMASK_API_KEY`}),` instead, then paste the key and press Enter.`]}),_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`Copy command`}),`, then paste the command into the same terminal and run it. The command sends “Hello” to one of the key’s models. A JSON response with a reply means your key works. Test requests are billed like any other request.`]}),_jsxs(_components.p,{children:[`When you’re done, click `,_jsx(_components.strong,{children:`I’ve saved it`}),` to close the dialog.`]}),_jsx(Frame,{caption:`Copy your key before you close the dialog, then test it with the ready-made command.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/save-key.jpg?fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=237c8f7d85001eec8a8c07de974d1b6d`,alt:`Save your API key dialog with the key in a read-only field, the Copy key button, the Shown once warning, an expanded Test your key section with a cURL command and Copy command, and the I’ve saved it button.`,\"data-og-width\":`1410`,width:`1410`,\"data-og-height\":`1171`,height:`1171`,\"data-path\":`images/api/save-key.jpg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/save-key.jpg?w=280\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=b9f9cb5c1a70ba8bd08cb7e36efeac49 280w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/save-key.jpg?w=560\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=85b2c2a81466975544e3d3017b7dfad7 560w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/save-key.jpg?w=840\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=60c0b859e8fbae6a4caa572bd51ee870 840w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/save-key.jpg?w=1100\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=5909f24740dfb6f238a1def62e41304d 1100w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/save-key.jpg?w=1650\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=c0c671229ffdb4e0439b38c328b52f82 1650w, https://mintcdn.com/deepmaskgmbh/Tc7tJrGOE8MSnXNJ/images/api/save-key.jpg?w=2500\u0026fit=max\u0026auto=format\u0026n=Tc7tJrGOE8MSnXNJ\u0026q=85\u0026s=7f1ca8cdc159d7228c73d24e3d92c1e0 2500w`})})]})]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Keep your key on your server. Read it from an environment variable or a secrets manager, and never put it in browser code, mobile apps, or version control.`})}),`\n`,_jsx(Heading,{level:`2`,id:`make-your-first-request`,children:`Make your first request`}),`\n`,_jsxs(_components.p,{children:[`Send a chat completion to `,_jsx(_components.code,{children:`POST /v1/chat/completions`}),`. Each example reads your key from `,_jsx(_components.code,{children:`DEEPMASK_API_KEY`}),` and uses `,_jsx(_components.code,{children:`gpt-4o`}),`. To use another model, copy its `,_jsx(_components.strong,{children:`API model ID`}),` from the `,_jsx(_components.strong,{children:`Models`}),` tab and make sure your key can use it.`]}),`\n`,_jsxs(_components.p,{children:[`To run the SDK examples, install the official `,_jsx(_components.code,{children:`openai`}),` package:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Python:`}),` Run `,_jsx(_components.code,{children:`pip install openai`}),`. Save the example as `,_jsx(_components.code,{children:`quickstart.py`}),` and run `,_jsx(_components.code,{children:`python quickstart.py`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Node.js:`}),` Run `,_jsx(_components.code,{children:`npm install openai`}),`. Save the example as `,_jsx(_components.code,{children:`quickstart.mjs`}),` in the same folder and run `,_jsx(_components.code,{children:`node quickstart.mjs`}),`. The `,_jsx(_components.code,{children:`.mjs`}),` extension lets the file use `,_jsx(_components.code,{children:`import`}),` and top-level `,_jsx(_components.code,{children:`await`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Run the examples in the same terminal where you set `,_jsx(_components.code,{children:`DEEPMASK_API_KEY`}),`. In Windows PowerShell, set the variable with `,_jsx(_components.code,{children:`$env:DEEPMASK_API_KEY = \"sk-...\"`}),` instead.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`11`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.deepmask.io/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$DEEPMASK_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gpt-4o\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {\"role\": \"system\", \"content\": \"You are a concise assistant.\"},`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {\"role\": \"user\", \"content\": \"Explain what an API key is in one sentence.\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 200`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`18`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.deepmask.io/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"DEEPMASK_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.chat.completions.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a concise assistant.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Explain what an API key is in one sentence.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_tokens`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(response.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`17`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.deepmask.io/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`DEEPMASK_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"gpt-4o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"You are a concise assistant.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Explain what an API key is in one sentence.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` max_tokens:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The API accepts a fixed set of request fields. `,_jsx(_components.code,{children:`max_tokens`}),`, used in the examples above, is one of them. Sampling options such as `,_jsx(_components.code,{children:`temperature`}),`, `,_jsx(_components.code,{children:`top_p`}),`, `,_jsx(_components.code,{children:`stop`}),`, and `,_jsx(_components.code,{children:`seed`}),` are accepted within their ranges. Some models ignore some of these options without an error. Some models refuse certain values, such as a `,_jsx(_components.code,{children:`temperature`}),` above 1. Other parameters, such as `,_jsx(_components.code,{children:`response_format`}),` and `,_jsx(_components.code,{children:`logprobs`}),`, are refused with a `,_jsx(_components.code,{children:`400`}),` error and the code `,_jsx(_components.code,{children:`API_REQUEST_UNBOUNDED`}),`. So is an `,_jsx(_components.code,{children:`n`}),` value other than 1. Check `,_jsx(_components.a,{href:`/api/chat-completions#sampling-options`,children:`Sampling options`}),` and `,_jsx(_components.a,{href:`/api/chat-completions#unsupported-parameters`,children:`Unsupported parameters`}),` before you add options.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`read-the-response`,children:`Read the response`}),`\n`,_jsxs(_components.p,{children:[`A successful request returns HTTP `,_jsx(_components.code,{children:`200`}),` with a standard chat completion object. This example is abbreviated, and your values will differ:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`20`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chatcmpl-...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat.completion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"choices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"An API key is a secret token that identifies your app when it calls an API.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finish_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`27`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`18`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`45`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`choices[0].message.content`}),` contains the model’s reply.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`usage`}),` shows the input and output tokens of the request. Requests are billed by token. See `,_jsx(_components.a,{href:`/api/models`,children:`Models`}),` for how pricing works.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Your request also appears in the `,_jsx(_components.strong,{children:`Request log`}),` on the `,_jsx(_components.strong,{children:`Usage`}),` tab. If you don’t see it yet, click `,_jsx(_components.strong,{children:`Refresh`}),` at the top of the page. See `,_jsx(_components.a,{href:`/api/usage-and-logs`,children:`Usage and logs`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`To receive the reply in pieces as the model writes it, set `,_jsx(_components.code,{children:`stream`}),` to `,_jsx(_components.code,{children:`true`}),`. See `,_jsx(_components.a,{href:`/api/chat-completions`,children:`Chat completions`}),` for streaming, tools, and all supported fields.`]}),`\n`,_jsx(Heading,{level:`2`,id:`if-your-first-request-fails`,children:`If your first request fails`}),`\n`,_jsxs(_components.p,{children:[`Every error returns a JSON body whose `,_jsx(_components.code,{children:`error.code`}),` names the problem, such as `,_jsx(_components.code,{children:`API_MODEL_NOT_ALLOWED`}),`. The `,_jsx(_components.code,{children:`error.message`}),` is always the same, so check the HTTP status and `,_jsx(_components.code,{children:`error.code`}),`. See `,_jsx(_components.a,{href:`/api/errors#error-response-format`,children:`Error response format`}),` for the full body.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`What to check`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`401`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`API_CREDENTIAL_INVALID`})}),_jsxs(_components.td,{children:[`The key is missing, mistyped, or revoked. Send exactly one `,_jsx(_components.code,{children:`Authorization: Bearer \u003ckey>`}),` header.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`403`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`API_SUBSCRIPTION_INACTIVE`})}),_jsxs(_components.td,{children:[`API billing isn’t active, or your organization isn’t on an active paid plan. Check the `,_jsx(_components.strong,{children:`API billing`}),` status on the `,_jsx(_components.strong,{children:`Billing`}),` tab and any notice at the top of the API page.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`403`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`API_MODEL_NOT_ALLOWED`})}),_jsxs(_components.td,{children:[`The key can’t use this model. Use the exact `,_jsx(_components.strong,{children:`API model ID`}),`, and make sure the key includes the model.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`API_REQUEST_INVALID`})}),_jsxs(_components.td,{children:[`The body isn’t valid JSON, the `,_jsx(_components.code,{children:`Content-Type: application/json`}),` header is missing, or `,_jsx(_components.code,{children:`model`}),` is missing. Check your quoting and headers.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`API_REQUEST_UNBOUNDED`})}),_jsxs(_components.td,{children:[`The request contains a field or value the API doesn’t accept, such as `,_jsx(_components.code,{children:`response_format`}),` or a `,_jsx(_components.code,{children:`temperature`}),` above 2.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`API_ENDPOINT_NOT_FOUND`})}),_jsxs(_components.td,{children:[`The path isn’t supported. Check that your base URL is exactly `,_jsx(_components.code,{children:`https://api.deepmask.io/v1`}),`, and call `,_jsx(_components.code,{children:`/v1/chat/completions`}),` without a trailing slash. A path outside `,_jsx(_components.code,{children:`/v1/`}),` returns `,_jsx(_components.code,{children:`404`}),` with an empty body.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`429`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`API_CONCURRENCY_LIMIT`}),`, `,_jsx(_components.code,{children:`API_RPM_LIMIT`}),`, `,_jsx(_components.code,{children:`API_TPM_LIMIT`}),`, `,_jsx(_components.code,{children:`API_RATE_LIMIT`}),`, `,_jsx(_components.code,{children:`API_MODEL_CAPACITY`})]}),_jsxs(_components.td,{children:[`You’ve reached a limit. Most limits are shared by all keys in your organization. Each key also has a few limits of its own. See `,_jsx(_components.strong,{children:`API limits`}),` on the `,_jsx(_components.strong,{children:`Usage`}),` tab and `,_jsx(_components.a,{href:`/api/limits#limits-at-a-glance`,children:`Limits at a glance`}),`. `,_jsx(_components.code,{children:`API_MODEL_CAPACITY`}),` means the model has reached its capacity limit, which all organizations share. Wait briefly and retry, or try another model.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`503`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`API_ADMISSION_UNAVAILABLE`})}),_jsxs(_components.td,{children:[`DeepMask can’t take requests for your organization right now. Wait a minute and retry. If it keeps happening, check the notice at the top of the API page. If it says requests are paused, don’t retry in a loop. See `,_jsx(_components.a,{href:`/api/errors#when-requests-are-paused`,children:`When requests are paused`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{\"data-numeric\":`true`,children:[_jsx(_components.code,{children:`503`}),`, `,_jsx(_components.code,{children:`504`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`API_INFERENCE_UNAVAILABLE`})}),_jsxs(_components.td,{children:[`DeepMask couldn’t get a response from the model. You aren’t billed unless usage for the request still arrives later. Retry with backoff, but don’t resend the request in a loop. More than 20 failures like this in 24 hours pause your organization’s requests. See `,_jsx(_components.a,{href:`/api/limits#unclear-outcomes`,children:`Unclear outcomes`}),`.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`To see which models your key can use, call `,_jsx(_components.code,{children:`GET /v1/models`}),`. It returns only the models granted to that key:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.deepmask.io/v1/models`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$DEEPMASK_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`For any other code, including spending cap refusals, see `,_jsx(_components.a,{href:`/api/errors`,children:`Errors and retries`}),`. For every limit, see `,_jsx(_components.a,{href:`/api/limits`,children:`Limits and fair use`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Manage API keys`,icon:`key`,href:`/api/keys`,children:_jsx(_components.p,{children:`Create keys per app or environment, review their status, and revoke keys you no longer need.`})}),_jsx(Card,{title:`Set spending caps`,icon:`gauge`,href:`/api/spending-caps`,children:_jsx(_components.p,{children:`Control monthly model costs with the organization-wide cap and optional per-key caps.`})}),_jsx(Card,{title:`Chat completions reference`,icon:`code`,href:`/api/chat-completions`,children:_jsx(_components.p,{children:`Learn the supported request fields, streaming, tool calling, and response format.`})}),_jsx(Card,{title:`Models and pricing`,icon:`list`,href:`/api/models`,children:_jsx(_components.p,{children:`Browse API models, find their model IDs, and learn how per-token pricing works.`})}),_jsx(Card,{title:`Limits and fair use`,icon:`sliders`,href:`/api/limits`,children:_jsx(_components.p,{children:`Check the rate, token, and budget limits that apply to your requests.`})}),_jsx(Card,{title:`Errors and retries`,icon:`triangle-exclamation`,href:`/api/errors`,children:_jsx(_components.p,{children:`Understand error codes, which errors to retry, and how to handle refused requests.`})}),_jsx(Card,{title:`Usage and logs`,icon:`chart-line`,href:`/api/usage-and-logs`,children:_jsx(_components.p,{children:`Track monthly charges, check your API limits, and review your requests.`})}),_jsx(Card,{title:`Billing`,icon:`receipt`,href:`/api/billing`,children:_jsx(_components.p,{children:`Understand your monthly API invoice and manage invoices and cancellation.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"API quickstart","sidebarTitle":"Quickstart","description":"Enable API billing, create your first API key, and send a chat completion request to DeepMask models from your own code.","keywords":["API","quickstart","API key","chat completions","OpenAI-compatible","OpenAI SDK","cURL","Python","Node.js","API billing"],"href":"/api/quickstart"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Before you start","slug":"before-you-start","depth":2,"children":[]},{"title":"Set up access and send a test request","slug":"set-up-access-and-send-a-test-request","depth":2,"children":[]},{"title":"Make your first request","slug":"make-your-first-request","depth":2,"children":[]},{"title":"Read the response","slug":"read-the-response","depth":2,"children":[]},{"title":"If your first request fails","slug":"if-your-first-request-fails","depth":2,"children":[]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"deepmaskgmbh","siteName":"DeepMask","title":"API quickstart - DeepMask","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/api/quickstart","matchLevel":0},"de":{"href":"/de/api/quickstart","matchLevel":1}}},"lastModified":"2026-11-16T16:01:24.588Z","originalFileLocation":"api/quickstart.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Enable API billing, create your first API key, and send a chat completion request to DeepMask models from your own code.\">\u003cmeta data-mint-head name=\"application-name\" content=\"DeepMask\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"API quickstart - DeepMask\">\u003cmeta data-mint-head property=\"og:description\" content=\"Enable API billing, create your first API key, and send a chat completion request to DeepMask models from your own code.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"DeepMask\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://documentation.deepmask.io/api/quickstart\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://deepmaskgmbh.mintlify.site/_mintlify/api/og/v2?division=Get+Started\u0026amp;title=API+quickstart\u0026amp;description=Enable+API+billing%2C+create+your+first+API+key%2C+and+send+a+chat+completion+request+to+DeepMask+models+from+your+own+code.\u0026amp;theme=e567b27b7b33e40a3da35b7a\u0026amp;signature=3b483dcc531433d17d7bc15e87c2d49423b044f7220824b12bbe86d8595a8ab8\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"API quickstart - DeepMask\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Enable API billing, create your first API key, and send a chat completion request to DeepMask models from your own code.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://deepmaskgmbh.mintlify.site/_mintlify/api/og/v2?division=Get+Started\u0026amp;title=API+quickstart\u0026amp;description=Enable+API+billing%2C+create+your+first+API+key%2C+and+send+a+chat+completion+request+to+DeepMask+models+from+your+own+code.\u0026amp;theme=e567b27b7b33e40a3da35b7a\u0026amp;signature=3b483dcc531433d17d7bc15e87c2d49423b044f7220824b12bbe86d8595a8ab8\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/deepmaskgmbh/hwlc6glwRXpXRbmg/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"DeepMask\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#139058\">\u003clink data-mint-head rel=\"canonical\" href=\"https://documentation.deepmask.io/api/quickstart\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/quickstart.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://documentation.deepmask.io/api/quickstart\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://documentation.deepmask.io/de/api/quickstart\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://documentation.deepmask.io/api/quickstart\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://documentation.deepmask.io/#organization\",\"name\":\"DeepMask\",\"url\":\"https://documentation.deepmask.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/deepmaskgmbh/wqYs4HgxrHF-vtoI/images/light-theme-logo-B6Sj8q9n.svg?fit=max\u0026auto=format\u0026n=wqYs4HgxrHF-vtoI\u0026q=85\u0026s=b2e82def8bcaaf56f11738b4e22b9748\"}},{\"@type\":\"WebSite\",\"@id\":\"https://documentation.deepmask.io#website\",\"name\":\"DeepMask\",\"url\":\"https://documentation.deepmask.io\",\"publisher\":{\"@id\":\"https://documentation.deepmask.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://documentation.deepmask.io/api/quickstart#webpage\",\"url\":\"https://documentation.deepmask.io/api/quickstart\",\"name\":\"API quickstart\",\"description\":\"Enable API billing, create your first API key, and send a chat completion request to DeepMask models from your own code.\",\"dateModified\":\"2026-11-16T16:01:24.588Z\",\"isPartOf\":{\"@id\":\"https://documentation.deepmask.io#website\"},\"breadcrumb\":{\"@id\":\"https://documentation.deepmask.io/api/quickstart#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://documentation.deepmask.io/api/quickstart#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Get Started\",\"item\":\"https://documentation.deepmask.io/api/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API quickstart\",\"item\":\"https://documentation.deepmask.io/api/quickstart\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://documentation.deepmask.io/api/quickstart#article\",\"headline\":\"API quickstart\",\"name\":\"API quickstart\",\"description\":\"Enable API billing, create your first API key, and send a chat completion request to DeepMask models from your own code.\",\"url\":\"https://documentation.deepmask.io/api/quickstart\",\"mainEntityOfPage\":{\"@id\":\"https://documentation.deepmask.io/api/quickstart#webpage\"},\"dateModified\":\"2026-11-16T16:01:24.588Z\",\"keywords\":\"API, quickstart, API key, chat completions, OpenAI-compatible, OpenAI SDK, cURL, Python, Node.js, API billing\",\"publisher\":{\"@id\":\"https://documentation.deepmask.io/#organization\"},\"isPartOf\":{\"@id\":\"https://documentation.deepmask.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"DeepMask\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"DeepMask\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/quickstart.md","siteName":"DeepMask","nav":{"global":null,"languages":[{"language":"en","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"Models","pages":[{"title":"Models","href":"/models/overview"}]},{"tab":"API","groups":[{"group":"Get Started","pages":[{"title":"DeepMask API","sidebarTitle":"Overview","description":"Call DeepMask models from your own apps and scripts with an OpenAI-compatible API, billed pay as you go.","href":"/api/overview"},{"title":"API quickstart","sidebarTitle":"Quickstart","href":"/api/quickstart"}]},{"group":"Manage","pages":[{"title":"API keys","sidebarTitle":"API keys","description":"Create API keys for your organization, choose which models each key can use, and revoke keys you no longer need.","href":"/api/keys"},{"title":"Spending caps","sidebarTitle":"Spending caps","href":"/api/spending-caps"},{"title":"Usage and request logs","sidebarTitle":"Usage and logs","href":"/api/usage-and-logs"},{"title":"API billing","sidebarTitle":"Billing","href":"/api/billing"}]},{"group":"Reference","pages":[{"title":"API models","sidebarTitle":"Models","href":"/api/models"},{"title":"Chat completions","sidebarTitle":"Chat completions","href":"/api/chat-completions"},{"title":"Limits and fair use","sidebarTitle":"Limits and fair use","href":"/api/limits"},{"title":"Errors and retries","sidebarTitle":"Errors and retries","href":"/api/errors"}]}]}]},{"language":"de","pages":[{"title":"de","href":"/de/api/quickstart"}]}]},"basePath":"","title":"API quickstart - DeepMask","deploymentId":"dpl_vSEmv961Ncyvz1psVwgUnTXQMSYk","buildId":"dpl_vSEmv961Ncyvz1psVwgUnTXQMSYk","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-BRsfsIIG.js","DynamicMarkdown-NFqqduU7.js","zoom-image-lightbox-BguUeq2N.js","lightbox-handle-r17bVUz3.js"]}