POST /api/zeq/llm/credentials
Create a new BYOK credential. The full key is echoed exactly once in the response — copy it now or recreate. After that, only the prefix is ever returned.
Auth
Authorization: Bearer zeq_ak_…. Paid-tier only.
Request
curl -X POST https://YOUR-FRAMEWORK/api/zeq/llm/credentials \
-H "Authorization: Bearer zeq_ak_..." \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"label": "prod-key-2026-q2",
"api_key": "sk-proj-AbCd...",
"default_model": "gpt-4o",
"base_url": null
}'
Body
| Field | Type | Required | Notes |
|---|---|---|---|
provider | enum | yes | One of openai, anthropic, deepseek, ollama, openrouter, together, groq, fireworks. |
label | string (1–64) | yes | Human label for the dashboard. |
api_key | string (8–512) | yes | The provider key. Trimmed and stripped of trailing punctuation server-side. |
default_model | string (1–128) | no | Override the provider default. |
base_url | url | no | Required for ollama. Optional for OpenAI-compat providers. Must start with http:// or https://. |
Response · 201 Created
{
"id": "5b7a9c12-3f1d-...",
"provider": "openai",
"provider_name": "OpenAI",
"label": "prod-key-2026-q2",
"api_key_prefix": "sk-p…AbCd",
"base_url": null,
"default_model": "gpt-4o",
"active": true,
"created_at": "2026-05-10T13:08:32Z",
"api_key_one_time_echo": "sk-proj-AbCd..."
}
api_key_one_time_echois the only place you'll ever see the full key. Subsequent reads returnapi_key_prefixonly.
Errors
| Status | Code | Cause |
|---|---|---|
400 | provider must be one of: ... | Bad provider ID. |
400 | api_key required | Missing or empty. |
400 | api_key invalid length: N chars (need 8..512) | Out of range. |
400 | label required (1..64 chars) | Missing or out of range. |
400 | base_url required for provider <id> | Ollama without base_url. |
400 | base_url must start with http:// or https:// | Bad URL. |
402 | SUBSCRIPTION_REQUIRED | Free-tier caller. |
409 | label_taken | Same label exists for this user. |
Related
GET /credentials— listDELETE /credentials/:id— revoke- BYOK concept