API Overview
This platform provides a unified API that is fully compatible with the official OpenAI protocol, aggregating chat, completion, embeddings, image, audio, and video capabilities.
Base URL
https://api.idreame.ai/v1Authentication
All endpoints authenticate via a Bearer Token in the request header:
Authorization: Bearer sk-xxxxxxxxEndpoints
| Endpoint | Method | Description |
|---|---|---|
/v1/models | GET | List available models |
/v1/chat/completions | POST | Chat completions (core endpoint) |
/v1/embeddings | POST | Text embeddings |
/v1/rerank | POST | Document reranking |
/v1/images/generations | POST | Text-to-image |
/v1/images/edits | POST | Image editing (image-to-image) |
/v1/audio/speech | POST | Text-to-speech (TTS) |
/v1/audio/transcriptions | POST | Speech-to-text (STT) |
/v1/videos | POST | Video generation (async) |
Other protocol formats
Beyond the OpenAI format, the gateway also natively supports the following protocols. The same sk-… token works for all of them:
| Protocol | Endpoint | Description |
|---|---|---|
| Claude Messages | POST /v1/messages | Anthropic's native message format, for Claude SDKs |
| OpenAI Responses | POST /v1/responses | OpenAI Responses API format |
| Gemini | POST /v1beta/models/{model}:generateContent | Google Gemini native format (streaming supported) |
| Realtime | WS /v1/realtime | WebSocket real-time bidirectional audio |
TIP
The gateway can convert between the OpenAI, Claude, and Gemini protocols: for example, you can use the Claude format to reach a model connected via the OpenAI protocol, and vice versa. Actual availability depends on the console's model and channel configuration.
Response format
Successful responses return JSON with a structure identical to OpenAI's. The error response structure:
{
"error": {
"message": "error description",
"type": "invalid_request_error",
"code": "model_not_found"
}
}See Error Codes.
Rate limiting
When request frequency is too high, the service returns 429 Too Many Requests. We recommend:
- Adding exponential backoff to retry logic (e.g. 1s → 2s → 4s)
- Using concurrency control for batch requests to avoid instantaneous spikes