Skip to main content
Moss Inference speaks OpenAI’s API, so any OpenAI client works once you change the base URL and the key. This page covers the endpoints, the Moss headers and what differs from OpenAI.

Set the base URL and key

The key is your project id and project key from the Moss portal, joined by a colon. Send it as a bearer token:

Point an OpenAI client at Moss

Change the base URL and the key. The X-Moss-Indexes header is optional and names the indexes to search. Install OpenAI’s client with pip install openai or npm install openai. The Vercel AI SDK needs npm install @ai-sdk/openai ai.
The Python and JavaScript tabs use OpenAI’s own clients. The Vercel AI SDK tab calls Chat Completions through .chat(). For the Moss SDKs, see SDKs.

Responses or Chat Completions

Both endpoints search the indexes a call names and take the same models, headers and limits. The same call on Chat Completions:

Moss headers

Both endpoints read these request headers. The last column names the matching Moss SDK option. The rules for X-Moss-Indexes and X-Moss-Retrieve are in Ground answers in your indexes. Your own key is covered in Bring your own key. Every reply carries these headers: The * is requests, and on moss/fastlane-1 also tokens. The limits themselves are in Errors and limits.

What is different from OpenAI

On Responses, Moss differs from OpenAI in these ways:
  • Moss stores no responses. store is ignored, and previous_response_id and conversation are refused. Send the whole conversation in input on every call. See Conversations.
  • Tools are function and mcp only. OpenAI’s built-in tools, such as web_search, file_search, code_interpreter, image_generation, computer use and shell, are refused. So are custom tools, and a tool_choice that names one.
  • Content parts are input_text, output_text, and input_image with an image_url. Files (input_file), audio (input_audio) and images by file_id are refused. The moss/fastlane-1 model reads text only.
  • Input items other than those listed, such as item_reference, are refused.
  • background: true, a non-empty include, prompt, and truncation: "auto" are refused.
  • reasoning takes effort only. text.verbosity takes medium only.
  • Any field missing from the Responses request table is refused, such as max_tool_calls or top_logprobs.
A refused field returns 400 with type invalid_request_error and code unsupported_parameter. The message names the field:
400 - Bad Request
On Chat Completions:
  • A reply without stream has one choice and no logprobs.
  • Chat Completions ends a stream with data: [DONE]. Responses sends none.
  • The last chunk before data: [DONE] has empty choices and the whole reply’s usage. See Streaming.
Vendor models on the Moss key also refuse some fields, such as temperature on an Anthropic model, with the same 400. The list per vendor is in Models.