Skip to content

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/v1

Authentication

All endpoints authenticate via a Bearer Token in the request header:

http
Authorization: Bearer sk-xxxxxxxx

See Authentication & Tokens.

Endpoints

EndpointMethodDescription
/v1/modelsGETList available models
/v1/chat/completionsPOSTChat completions (core endpoint)
/v1/embeddingsPOSTText embeddings
/v1/rerankPOSTDocument reranking
/v1/images/generationsPOSTText-to-image
/v1/images/editsPOSTImage editing (image-to-image)
/v1/audio/speechPOSTText-to-speech (TTS)
/v1/audio/transcriptionsPOSTSpeech-to-text (STT)
/v1/videosPOSTVideo 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:

ProtocolEndpointDescription
Claude MessagesPOST /v1/messagesAnthropic's native message format, for Claude SDKs
OpenAI ResponsesPOST /v1/responsesOpenAI Responses API format
GeminiPOST /v1beta/models/{model}:generateContentGoogle Gemini native format (streaming supported)
RealtimeWS /v1/realtimeWebSocket 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:

json
{
  "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

OpenAI-compatible · Multimodal AI gateway