Change your connection
Leave
/chat/completions off the base URL; the SDK adds it. An OpenAI model name is not automatically mapped to a NoMask model.
Set NOMASK_API_KEY and NOMASK_MODEL in your server environment, then run one of these examples. Replace your-model-id with a current text model ID.
- Python
- JavaScript
Install the SDK with
pip install openai.Choose OpenAI Compatible and Chat Completions when your tool offers multiple API modes. NoMask does not expose
/responses or Anthropic’s /messages endpoint. Tools that require those formats need an adapter; see Codex or Claude Code.Connect a framework
Use the same environment variables as above. Select Chat Completions explicitly when a framework also supports Responses.- Vercel AI SDK
- LangChain
Install Use
ai and @ai-sdk/openai.nomask.chat(...); the default model factory uses the Responses API. See the AI SDK OpenAI provider documentation.What carries over
Model capabilities and limits are available through
GET /models. For all fields, see Chat Completions. Video input uses NoMask’s supported video message format.
Images
NoMask also providesPOST /images/generations and POST /images/edits. Select an image model, request one image (n: 1), and use response_format: "b64_json". Images are returned inline rather than as hosted URLs. Supported dimensions, formats, and reference-image counts depend on the model.
The Image Generation reference covers generation, multipart edits, JSON references, and response decoding.
Add NoMask options
Keep your own instructions in asystem message. Use nomask_system_prompt to prepend NoMask’s persona, and reasoning options to control supported models. With Python, put NoMask-specific fields in extra_body; with JavaScript, add them to the request body.
- Python
- JavaScript
See Reasoning for model-specific adjustments and System Prompt for persona behavior.
Account for the differences
- Choose a NoMask model ID. IDs and capabilities come from the NoMask catalog. Unknown IDs return
404 model_not_found. - Use a NoMask balance. Paid requests draw from your prepaid USD balance. Completed responses add
nomask.cost_usd; see Billing & Funding. - Read extensions when needed. Responses can include
reasoning_content, warnings, and thenomaskmetadata object. A framework may not preserve every extra field. - Keep tools in your application. Function calls describe work for your code to execute. The developer API does not provide built-in web search or browsing tools.
- Use supported endpoints. Responses, legacy Completions, Embeddings, Audio, Files, Assistants, and Moderations APIs are not provided. Use Chat Completions for text and the documented image endpoints for images.
- Send file text as text. Extract document contents in your application; file uploads and file content parts are not supported by the chat endpoint.
Unsupported request options
These options return400 unsupported_parameter, with the field identified in error.param:
Start with the minimal SDK request, then add streaming, tools, or multimodal inputs supported by your selected model. Errors explains failure codes; Rate Limits covers retry behavior.
Chat Completions
Check request fields and the response format.
Coding tools
Connect an OpenAI-compatible coding assistant.