Skip to content

OpenAI Compatibility

CloudService is wire-compatible with the OpenAI API. Anything that speaks OpenAI's protocol can talk to CloudService by changing thebase_url.

Use the matching OpenAI-compatible base URL

  • API-credit key: https://api.yourdomain.example/v1
  • API-token key: https://api.yourdomain.example/token/v1

These are the two OpenAI-compatible surfaces. A Claude token key can use the token /v1 route only when the client uses an OpenAI-compatible adapter, and it must select a Claude model returned by that key's catalog. Native Anthropic Messages clients use an origin with no /v1; see Claude Code or Claude Desktop.

What's compatible

OpenAI featureSupported on CloudServiceNotes
Chat completions (request/response shape)Exact match.
Streaming (SSE)Same chunk format.
Function / tool callingNormalized to OpenAI format across providers.
System messagesPassed through to the underlying provider.
Token usage reportingusage in the response.
Vision / image inputsPartialProvider-dependent.
Audio (TTS / STT)Not exposed. The gateway is text-only for now.
Embeddings (/v1/embeddings)Not exposed yet. Planned.
Assistants / ThreadsNot exposed. Out of scope.
Fine-tuningNot exposed. Use the upstream provider directly.

Differences from OpenAI

  • Provider selection is implicit in the model string. We don't expose a provider parameter.
  • Authentication uses CloudService keys, not OpenAI keys. They live in the same Authorization: Bearer header though.
  • Rate limits are per CloudService key, not per OpenAI organization.
  • Error envelope matches OpenAI's shape:
error
{
  "error": {
    "message": "Invalid API key",
    "type": "invalid_request_error",
    "code": "invalid_credentials"
  }
}

SDK compatibility

SDKStatus
openai (Python)✅ works
openai (JavaScript / Node)✅ works
openai-go✅ works
openai-compatible tools⚠️ partial
langchain (via OpenAI adapter)✅ works
Cursor / OpenAI-compatible tools✅ works (point at CloudService base URL)

For SDK-specific examples see the OpenAI SDK example.