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 feature | Supported on CloudService | Notes |
|---|---|---|
| Chat completions (request/response shape) | ✅ | Exact match. |
| Streaming (SSE) | ✅ | Same chunk format. |
| Function / tool calling | ✅ | Normalized to OpenAI format across providers. |
| System messages | ✅ | Passed through to the underlying provider. |
| Token usage reporting | ✅ | usage in the response. |
| Vision / image inputs | Partial | Provider-dependent. |
| Audio (TTS / STT) | — | Not exposed. The gateway is text-only for now. |
Embeddings (/v1/embeddings) | — | Not exposed yet. Planned. |
| Assistants / Threads | — | Not exposed. Out of scope. |
| Fine-tuning | — | Not exposed. Use the upstream provider directly. |
Differences from OpenAI
- Provider selection is implicit in the
modelstring. We don't expose aproviderparameter. - Authentication uses CloudService keys, not OpenAI keys. They live in the same
Authorization: Bearerheader 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
| SDK | Status |
|---|---|
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.