> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nomask.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# NoMask API

> Build with OpenAI-compatible chat completions, image generation, and your choice of NoMask models.

Bring NoMask's models into your apps, agents, and coding tools. Use the OpenAI SDKs you already know, with a NoMask API key, base URL, and model ID.

[Get an API key ](https://nomask.ai/api/keys)

[Make your first request ](https://docs.nomask.ai/quickstart.md)

```python Python theme={"system"}
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["NOMASK_API_KEY"],
    base_url="https://nomask.ai/api/v1",
)

response = client.chat.completions.create(
    model=os.environ["NOMASK_MODEL"],
    messages=[{"role": "user", "content": "Explain HTTP caching in two sentences."}],
)

print(response.choices[0].message.content)
```

```javascript JavaScript theme={"system"}
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.NOMASK_API_KEY,
  baseURL: "https://nomask.ai/api/v1",
});

const response = await client.chat.completions.create({
  model: process.env.NOMASK_MODEL,
  messages: [{ role: "user", content: "Explain HTTP caching in two sentences." }],
});

console.log(response.choices[0].message.content);
```

```bash curl theme={"system"}
curl https://nomask.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $NOMASK_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<JSON
{
  "model": "$NOMASK_MODEL",
  "messages": [{"role": "user", "content": "Explain HTTP caching in two sentences."}]
}
JSON
```

Set `NOMASK_API_KEY` to your key and `NOMASK_MODEL` to a text model ID from the [model catalog](https://nomask.ai/api/models). The [quickstart](https://docs.nomask.ai/quickstart.md) includes installation and environment setup.

**API base URL:** `https://nomask.ai/api/v1`

## Endpoints

One API key for text, images, and account data. Choose an endpoint to explore its request format and supported options.

> [card] [Chat completions](https://docs.nomask.ai/api-reference/chat-completions.md)
>
> Generate text, stream responses, and use tools through the OpenAI Chat Completions format.
>
> `POST /chat/completions`

> [card] [Image generation and editing](https://docs.nomask.ai/api-reference/image-generations.md)
>
> Create images from prompts or edit reference images with OpenAI-compatible image endpoints.
>
> `POST /images/generations` · `POST /images/edits`

> [card] [Vision and video inputs](https://docs.nomask.ai/vision.md)
>
> Add image inputs to chat. Supported models also accept video inputs.
>
> Image understanding · Video inputs

> [card] [Account and usage](https://docs.nomask.ai/api-reference/balance.md)
>
> Query model details, your USD balance, settled usage, and the calling key's limits.
>
> `GET /models` · `GET /balance` · `GET /usage`

Add [streaming](https://docs.nomask.ai/streaming.md), [function calling](https://docs.nomask.ai/function-calling.md), [reasoning controls](https://docs.nomask.ai/reasoning.md), or [video inputs](https://docs.nomask.ai/video-inputs.md) when your selected model supports them.

## OpenAI-compatible, with NoMask controls

Chat requests use familiar `messages`, `model`, and `stream` fields. Read replies from `choices`, and use the SDK streaming interface for incremental output. NoMask also provides image generation and editing endpoints, with supported options documented in the [image reference](https://docs.nomask.ai/image-generation.md).

* **Choose your model.** Select a public NoMask model ID and the capabilities your application needs.
* **Control the response.** Use supported sampling, reasoning, tool-calling, and [system prompt](https://docs.nomask.ai/system-prompt.md) options.
* **Track spend.** Pay from a prepaid USD balance. Completed requests report charges, with settled usage available in your dashboard.
* **Understand privacy.** Usage analytics exclude prompts and responses. Model privacy and optional cache behavior are explained in [Privacy](https://docs.nomask.ai/privacy.md).

Compatibility applies to the documented endpoints and parameters. [Migrate from OpenAI](https://docs.nomask.ai/openai-compatibility.md) to configure your client and check what your app can reuse.

## Models

Browse [Models](https://nomask.ai/api/models) for capabilities, pricing, and limits. Use the public `id` as the request's `model` value.

> [card] [Text models](https://nomask.ai/api/models)
>
> Choose a model for conversation, coding, or reasoning. Check its advertised support for tools, vision, video inputs, and caching.

> [card] [Image models](https://nomask.ai/api/models)
>
> Find models for generation and editing. Compare output options, reference-image requirements, and per-model pricing.

> [accordion] List models from your application
>
> Send your Bearer key to `GET /models` to read model IDs, capabilities, limits, and pricing. The response includes text and image models available to your account.
>
> ```bash theme={"system"}
> curl https://nomask.ai/api/v1/models \
>   -H "Authorization: Bearer $NOMASK_API_KEY"
> ```
>
> Use each entry's `type` to distinguish text and image models. Explore the request and response in the [interactive model reference](https://docs.nomask.ai/api-reference/list-models.md).

## Connect your coding tools

> [card] [Codex](https://docs.nomask.ai/integration-codex.md)
>
> Configure the NoMask provider and select a model.

> [card] [Claude Code](https://docs.nomask.ai/integration-claude-code.md)
>
> Connect through the documented adapter setup.

> [card] [Cline](https://docs.nomask.ai/integration-cline.md)
>
> Use NoMask with an OpenAI-compatible provider.

More integrations: [Roo Code](https://docs.nomask.ai/integration-roo-code.md), [Command Code](https://docs.nomask.ai/integration-command-code.md), [Kilo Code](https://docs.nomask.ai/integration-kilo-code.md), [OpenCode](https://docs.nomask.ai/integration-opencode.md), and [Aider](https://docs.nomask.ai/integration-aider.md).

## Next steps

> [card] [Quickstart](https://docs.nomask.ai/quickstart.md)
>
> Create a key and run your first completion in Python, JavaScript, or curl.

> [card] [Migrate from OpenAI](https://docs.nomask.ai/openai-compatibility.md)
>
> Reuse your Chat Completions code with NoMask's supported parameters.

> [card] [API keys](https://docs.nomask.ai/authentication.md)
>
> Create and manage credentials for your applications.

> [card] [Billing and funding](https://docs.nomask.ai/billing.md)
>
> Add credits and see how model usage becomes a charge.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.