Skip to content

OpenAI API Compatibility

TrustedRails API keys provide OpenAI-compatible access through the proxy. This page documents what is currently supported on the OpenAI surface. The same keys and models are also served over the Anthropic Messages API; see Anthropic API Compatibility.

https://proxy.trustedrails.com/v1

| Endpoint | Status | |---|---| | POST /chat/completions | Supported | | POST /completions | Supported (legacy) | | POST /embeddings | Supported | | GET /models | Supported | | GET /test-auth | Supported; returns key status and current rate limit |

The following parameters are supported in /v1/chat/completions requests:

| Parameter | Supported | |---|---| | model | Yes | | messages | Yes | | temperature | Yes | | top_p | Yes | | max_tokens | Yes | | stream | Yes | | stop | Yes | | presence_penalty | Yes | | frequency_penalty | Yes | | tools | Yes | | tool_choice | Yes | | reasoning_effort | Yes: "none" disables thinking, other values enable it; "high" / "max" select the deepest mode on models with depth levels (see below) | | thinking | Accepted for compatibility (native on/off object) | | reasoning | Accepted for compatibility (OpenRouter dialect) |

Many of the models TrustedRails serves are reasoning models; whenever a model thinks, the thinking is billed as output tokens. The standard control is reasoning_effort: "none" disables thinking; "low" / "medium" / "high" / "max" enable it on models with a thinking switch. On DeepSeek V4 Flash, "high" and "max" additionally engage the model's deepest reasoning mode; the lower levels use its default depth.

{
"model": "zai-org/GLM-5.3-Flash",
"messages": [{"role": "user", "content": "Name three colors."}],
"reasoning_effort": "none"
}

For maximum client compatibility the proxy also accepts the native thinking: {"type": "enabled" | "disabled"} object and the OpenRouter-style reasoning object — all three map to the same switch (the most specific wins if several are sent). How much control a model offers varies; see Supported Models.

Models that think (MiniMax M2.7, DeepSeek V4 Flash, GLM-5.3-Flash) return the thinking in a dedicated reasoning field, never inside content:

  • non-streaming: choices[0].message.reasoning
  • streaming: choices[].delta.reasoning deltas, arriving before the content deltas

Clients that don't know the field simply ignore it and see clean answer text. The legacy /v1/completions shape has no such field, so thinking is dropped there.

The content field in messages supports both formats:

  • String: plain text value ("content": "Hello")
  • Array: structured content parts ("content": [{"type": "text", "text": "Hello"}])

Both formats are fully supported. However, only text content parts are available; image and other multimodal content types are not supported.

Responses follow the OpenAI Chat Completions response format:

  • id: unique response identifier
  • object: "chat.completion"
  • choices: array of completion choices
  • usage: token usage statistics (prompt_tokens, completion_tokens, total_tokens)

Streaming responses use Server-Sent Events (SSE), matching the OpenAI streaming format. The final chunk of every stream includes a usage object with token counts.

The proxy applies the following processing to your requests:

  • Standard OpenAI defaults are applied for omitted parameters (e.g., temperature: 0.7)
  • max_tokens is clamped to the model's maximum output length
  • Multimodal content (image inputs) is not supported; only text content parts are accepted

POST /v1/embeddings follows the OpenAI Embeddings API format. It works only with embedding models (see Supported Models): generative models return 404 on this endpoint, and embedding models return 404 on the chat endpoints.

| Parameter | Supported | |---|---| | model | Yes | | input | Yes; a string or a non-empty array of strings | | encoding_format | Yes; "float" (default) or "base64" | | dimensions | No; requests with dimensions are rejected with 400 |

Example request:

{
"model": "BAAI/bge-m3",
"input": ["First text to embed", "Second text to embed"]
}

The response follows the OpenAI embeddings format: a data array with one embedding vector per input, and a usage object with prompt_tokens and total_tokens. Billing is based on input tokens only.

Limits:

  • Each input can be up to 8,192 tokens; longer inputs return an error instead of being silently truncated
  • The request body is limited to 2 MiB

The following OpenAI features are not currently available:

  • Responses API (/v1/responses)
  • Images API
  • Audio API (TTS, STT)
  • Assistants API
  • Fine-tuning API
  • Vision (image inputs)
  • JSON mode / structured outputs

These may be added in future releases. Check back for updates.