Skip to main content
This guide takes you from an API key to a text response using the OpenAI Python or JavaScript SDK, or curl. You need a NoMask account and a funded credit balance.
1

Create an API key

Open API Keys and select Create Key. Give the key a name, then optionally set an expiration date and a monthly USD spending limit.Copy the key when it is created, or use the copy icon in your key list later.
Keep your key on your server or in a local environment variable. Do not include it in browser code or commit it to source control.
2

Add credits

In the API dashboard, select Buy credits beside your balance. The funding window shows the available payment methods and current minimum purchase. Your balance updates after payment confirmation.API usage spends the USD value of your credits. See Billing & Funding for pricing and how charges are calculated.
3

Choose a model and set your environment

Open Models, select a text model, and copy its public model ID. You can also query the authenticated List models endpoint with your NoMask API key.Replace both placeholders below. NOMASK_MODEL must be an actual NoMask model ID from the catalog.
Run the following examples in the same terminal session so they can read these variables.
4

Send your first request

Choose a language. Each example calls POST /chat/completions at https://nomask.ai/api/v1 and reads the assistant’s reply.
Install the OpenAI SDK:
Save this as quickstart.py:
Run it:

Read the response

The SDK examples print the assistant’s text. curl returns the full OpenAI-compatible chat.completion object. View settled requests and charges in your API dashboard. Token usage can be estimated when model-reported counts are unavailable; usage history identifies those estimates.

If the request fails

See Errors for the complete error format and Rate Limits for retry guidance.

Keep building

Migrate from OpenAI

Reuse your Chat Completions code with NoMask’s configuration and supported parameters.

Stream a response

Display output as it arrives with the SDK streaming interface.

Generate an image

Choose an image model and send your first image request.

Connect a coding tool

Set up Cline with an OpenAI-compatible NoMask provider.