🛡
ViesAI API Documentation: This page is personalized with your account, base URL and available models. Your key value is not included.
cc_live_****1C7A

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:

OpenAI-compatible base URL
https://viesai.com/v1
Anthropic base URL
https://viesai.com

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.

curl "https://viesai.com/v1/models" \
  -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.

curl -X POST "https://viesai.com/v1/chat/completions" \
  -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.

curl -X POST "https://viesai.com/messages" \
  -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-0731deepseek-v4-flashchat / kod65.536
deepseek-r1deepseek-r1muhakeme65.536
deepseek-v3deepseek-v3chat131.072
llama-3.3-70bllama-3.3-70bgenel131.072
qwen2.5-72bqwen2.5-72bchat32.768
mistral-small-24bmistral-small-24bchat32.768

12. HTTP Status Codes and Error Format

HTTP error.code Description
401authentication_errorAPI key invalid or missing.
403quota / permissionNo active subscription, model not in plan or user is inactive.
404model_not_foundModel not found or inactive.
429rate_limited / quota_exceededMinute/day/month limit exceeded; try again.
502/503upstream_errorProvider 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.

Daily Requests

100 / 1000

Monthly Requests

3.000 / 10.000

Minute Limit

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)

# Python Official OpenAI SDK
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"
}
✓ Roo Code ✓ Cline ✓ Cursor ✓ Claude Code

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.