Quickstart
This platform is built on the OpenAI-compatible protocol and provides a unified gateway for chat, image, audio, and video capabilities. Any SDK or client that supports a custom baseURL can connect directly, with no changes to your business code.
Prerequisites
- Register and sign in at the console
- Create an API token on the Tokens page (format:
sk-…) - Make sure your account has enough balance (requests are rejected when the balance runs out — see Billing & Recharge)
Base URL
The entry point for all endpoints:
https://api.idreame.ai/v1Minimal example
Python (OpenAI SDK)
Just replace base_url and api_key; the rest of the code is identical to calling OpenAI directly:
python
from openai import OpenAI
client = OpenAI(
base_url="https://api.idreame.ai/v1",
api_key="sk-xxxxxxxx", # replace with your token
)
resp = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)Node.js (OpenAI SDK)
javascript
import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://api.idreame.ai/v1',
apiKey: 'sk-xxxxxxxx', // replace with your token
})
const resp = await client.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }],
})
console.log(resp.choices[0].message.content)cURL
bash
curl https://api.idreame.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxxxx" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}]
}'Next steps
- Authentication & Tokens — how to manage API tokens
- API Overview — the full list of endpoints
- Available Models — the models currently offered
- Billing & Recharge — how billing works