1. Base URL and Authentication
ViesAI is an API distribution gateway compatible with most OpenAI and Anthropic SDKs. Two protocols are supported; both authenticate with a Bearer token / API key:
Authentication: Send your key on every request. OpenAI endpoints use the Authorization: Bearer <KEY> header, while Anthropic endpoints use x-api-key: <KEY>. Your key mask: cc_live_****1C7A — you only see the real value on the panel screen where you created the key.
2. API Key Management (Create / Rotate / Revoke)
You can create, rotate and revoke keys from the API Keys page in the panel. Endpoints:
- • POST /panel/api-keys — new key (plain text is shown only in this response)
- • POST /panel/api-keys/{id}/rotate — rotates the key (the old key is revoked)
- • POST /panel/api-keys/{id}/revoke — permanent revocation
- • POST /panel/api-keys/{id}/reactivate — re-activates a revoked key
Security: Keys are stored as SHA-256 hashes in the database; plain text is shown once only at creation/rotation time. The key value is never printed in this documentation.
3. GET /v1/models
Lists the models you have access to. Returns the OpenAI-compatible { "object": "list", "data": [...] } format.
-H "Authorization: Bearer YOUR_API_KEY"
"object": "list",
"data": [
{
"id": "deepseek-V4-Flash-0731",
"object": "model",
"owned_by": "viesai",
"display_name": "deepseek-v4-flash",
"context_window": 65536,
"max_tokens": 8192
}
]
}
4. POST /v1/chat/completions (OpenAI Chat)
Fully compatible with OpenAI Chat Completions. Required fields: model, messages. Optional: temperature, top_p, max_tokens, stop, tools, response_format, stream etc.
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-V4-Flash-0731",
"messages": [{ "role": "user", "content": "Merhaba" }],
"stream": false
}'
5. POST /v1/responses (OpenAI Responses)
OpenAI Responses API format. Accepts input and optional instructions; the response is returned as a response object. Codex CLI uses this endpoint.
6. POST /v1/messages (Anthropic Messages)
Anthropic Messages API format. max_tokens is required. Authentication uses x-api-key + anthropic-version: 2023-06-01.
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-V4-Flash-0731",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "Merhaba" }]
}'
7. Request / Response JSON Schema
The Chat Completions request body consists of the following fields. model and messages are required; other fields are optional and forwarded to the upstream as sent.
8. SSE Streaming (stream: true)
If you send stream: true in Chat Completions, the response is an SSE (Server-Sent Events) stream. Each data: line is a JSON chunk; it ends with [DONE].
9. Tools / Function Calling
The OpenAI Chat endpoint forwards the tools and tool_choice fields upstream. The response may contain tool_calls.
10. Multi-turn Conversation
Stateless: send the full messages array on every request. Include previous assistant responses as conversation history.
11. Supported Models
Use the platform name in the id column as the model identifier in requests. The list depends on your plan; fetch your current list via GET /v1/models.
| Model ID | Name | Category | Context |
|---|---|---|---|
| deepseek-V4-Flash-0731 | deepseek-v4-flash | chat / kod | 65.536 |
| deepseek-r1 | deepseek-r1 | muhakeme | 65.536 |
| deepseek-v3 | deepseek-v3 | chat | 131.072 |
| llama-3.3-70b | llama-3.3-70b | genel | 131.072 |
| qwen2.5-72b | qwen2.5-72b | chat | 32.768 |
| mistral-small-24b | mistral-small-24b | chat | 32.768 |
12. HTTP Status Codes and Error Format
| HTTP | error.code | Description |
|---|---|---|
| 401 | authentication_error | API key invalid or missing. |
| 403 | quota / permission | No active subscription, model not in plan or user is inactive. |
| 404 | model_not_found | Model not found or inactive. |
| 429 | rate_limited / quota_exceeded | Minute/day/month limit exceeded; try again. |
| 502/503 | upstream_error | Provider did not respond or is under maintenance. |
13. Quotas and Limits (Daily / Monthly / Minute)
Quota accounting is request-based; each successful request counts as 1. Daily limits reset according to the Europe/Istanbul timezone; monthly limits follow the calendar month.
100 / 1000
3.000 / 10.000
20 / dk (taban)
14. Rate Limiting and Quota Overflow Behavior
When a limit is exceeded the request is rejected with 429 Too Many Requests and the quota counter is not incremented (rejected requests do not consume quota). Quota credit is only deducted on successful requests and refunded on upstream errors.
15. Request History and Usage Statistics
- • GET /panel/usage-stats — today's/monthly counters and limits.
- • GET /panel/usage-logs — parsed request log.
16 & 17. Language SDK Integrations (OpenAI & Anthropic)
from openai import OpenAI
client = OpenAI(
base_url="https://viesai.com/v1",
api_key="YOUR_API_KEY"
)
r = client.chat.completions.create(
model="deepseek-V4-Flash-0731",
messages=[{"role": "user", "content": "Merhaba"}]
)
print(r.choices[0].message.content)
19. IDE / CLI Settings (Roo Code, Cline, Cursor, Claude Code, Aider)
In tools that use OpenAI-compatible providers, paste the following JSON into the OpenAI-compatible provider settings:
"api_provider": "openai",
"openai_api_key": "YOUR_API_KEY",
"openai_api_base": "https://viesai.com/v1",
"model": "deepseek-V4-Flash-0731"
}
20. Compatibility Notes and Supported Features
- Three protocols are supported: OpenAI Chat, OpenAI Responses, Anthropic Messages. All are routed through a single gateway.
- The platform id is used as the model identifier; the upstream model name is hidden.
- Streaming SSE is supported; stream_options.include_usage is added automatically.
- tools/tool_choice are forwarded upstream; support depends on the upstream provider.
- Quota is request-based; the counter increases on streaming and successful requests and is refunded on errors.