Developer docs
Connect to 5Veda Gateway
All customer requests use https://api.5veda.cn/v1, with Authorization: Bearer veda_live_....
New API channel configuration
| Field | Value |
|---|---|
| Channel type | OpenAI Compatible |
| Base URL | https://api.5veda.cn/v1 |
| Key | veda_live_... or veda_test_... |
Chat Completions
curl
curl https://api.5veda.cn/v1/chat/completions \
-H "Authorization: Bearer veda_live_..." \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_CHAT_MODEL","messages":[{"role":"user","content":"Introduce 5Veda Gateway in one sentence"}]}'Streaming
curl
curl -N https://api.5veda.cn/v1/chat/completions \
-H "Authorization: Bearer veda_live_..." \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_CHAT_MODEL","stream":true,"messages":[{"role":"user","content":"stream a short answer"}]}'Embeddings
curl
curl https://api.5veda.cn/v1/embeddings \
-H "Authorization: Bearer veda_live_..." \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_EMBEDDING_MODEL","input":"text to embed"}'Images
curl
curl https://api.5veda.cn/v1/images/generations \
-H "Authorization: Bearer veda_live_..." \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_IMAGE_MODEL","prompt":"clean product render","size":"1024x1024"}'Video Tasks
curl
curl https://api.5veda.cn/v1/contents/generations/tasks \
-H "Authorization: Bearer veda_live_..." \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_VIDEO_MODEL","content":[{"type":"text","text":"short product demo video"}]}'
curl https://api.5veda.cn/v1/contents/generations/tasks/TASK_ID \
-H "Authorization: Bearer veda_live_..."Usage & Billing
curl
curl https://api.5veda.cn/v1/usage?limit=100 \
-H "Authorization: Bearer veda_live_..."
curl https://api.5veda.cn/v1/billing?limit=100 \
-H "Authorization: Bearer veda_live_..."Usage and billing APIs only return data for the customer that owns the current API key. Plaintext keys are never returned.
Common error codes
| HTTP | code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing or invalid Bearer key. |
| 402 | insufficient_credit | The prepaid balance is insufficient. |
| 403 | model_not_allowed | The model is not enabled for this customer. |
| 501 | unsupported_endpoint | This OpenAI endpoint is not implemented by the gateway yet. |