Developer docs
接入 5Veda Gateway
所有客户请求统一使用 https://api.5veda.cn/v1,通过 Authorization: Bearer veda_live_... 鉴权。
New API 渠道配置
| 字段 | 填写值 |
|---|---|
| Channel type | OpenAI Compatible |
| Base URL | https://api.5veda.cn/v1 |
| Key | veda_live_... 或 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":"请用一句话介绍 5Veda Gateway"}]}'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":"需要向量化的文本"}'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","prompt":"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_..."用量和账单接口只返回当前 API key 所属客户的数据,不返回明文 key。
常见错误码
| HTTP | code | 含义 |
|---|---|---|
| 401 | unauthorized | 缺少或错误的 Bearer key。 |
| 402 | insufficient_credit | 预付余额不足。 |
| 403 | model_not_allowed | 模型未对该客户授权。 |
| 501 | unsupported_endpoint | 当前网关暂未实现该 OpenAI 端点。 |