Developer Guide
Sprelay exposes multiple protocols on one domain. Keep the SDK or request format your project already uses, then change only the base URL, API key, and model ID.
| Protocol | Typical use | Guide |
|---|---|---|
| Chat Completions | Existing OpenAI SDKs and chat clients | Chat Completions |
| Responses | Modern agents and Codex | Responses |
| Claude Messages | Anthropic SDK and Claude Code | Claude Messages |
| Gemini Native | Gemini-native content structure | Gemini Native |
| Image generation | gpt-image-2 image requests | Image Generation |
Base URLs
| Scenario | URL |
|---|---|
| OpenAI SDK, Chat, and Responses | https://sprelaytoken.com/v1 |
| Claude SDK | https://sprelaytoken.com |
| Gemini native SDK | https://sprelaytoken.com |
| Complete Chat endpoint | https://sprelaytoken.com/v1/chat/completions |
| Complete image endpoint | https://sprelaytoken.com/v1/images/generations |
Recommended validation order
text
GET /v1/models
-> minimal non-streaming request
-> streaming request
-> tool call
-> production payload and retry policyThe arrows show dependency order: do not debug tools or retries while the minimal text request still fails. Read the API errors guide before adding automatic retries.
Keep secrets in environment variables, set explicit timeouts, and log time, model, status, and request identifiers without logging complete keys or sensitive prompts. The API Reference is read-only and includes only confirmed public relay endpoints.
