VANGU / DEVELOPER
Endpoints & Parameter Reference
Complete payload, header and telemetry specifications across all supported protocols.
1. OpenAI Type Chat Completions
Provides text, JSON and streaming in the OpenAI Chat Completions schema. Supported fields work with OpenAI Python/Node SDKs; not every OpenAI hosted tool or state-storage feature is provided.
Request Headers
| Header | Value | Required | Description |
|---|---|---|---|
| Authorization | Bearer <API_KEY> | Yes | Your Vangu API developer token (`vgu_live_...`) |
| Content-Type | application/json | Yes | JSON body format |
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | An ID returned by GET /v1/models for your key, such as `gpt-6.1-sol`, `gpt-6-sol`, `gpt-6-luna` or `gpt-5.6-terra`. Astra access depends on your plan. |
| messages | array | Yes | Array of role and content objects |
| temperature | number | No (0.7) | Sampling randomness between 0.0 and 2.0 |
| max_tokens | integer | No | Upper bound limit for generated tokens |
| stream | boolean | No (false) | Stream tokens via Server-Sent Events |
| response_format | object | No | Enforce structured JSON output via `{"type": "json_object"}` |
| tools | array | No | Function definitions the model may invoke |
Sample Request & Response
curl https://api.vangu.dev/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer vgu_live_sample_token_67b8a901" \
-d '{
"model": "gpt-5.6-terra",
"messages": [
{"role": "system", "content": "Sen Vangu altyapı asistanısın."},
{"role": "user", "content": "Paket kotam ne zaman yenilenir?"}
],
"temperature": 0.5
}'
{
"id": "chatcmpl_98a76f21bc",
"object": "chat.completion",
"created": 1788796800,
"model": "gpt-5.6-terra",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Günlük paketinizin istek kotası her gece saat tam 00.00'da sıfırlanarak yenilenir."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 19,
"completion_tokens": 22,
"total_tokens": 41
}
}
SSE Streaming Format
When issuing requests with <code>"stream": true</code>, Vangu flushes token chunks immediately via Server-Sent Events:
data: {"id":"chatcmpl_98a76","choices":[{"delta":{"role":"assistant","content":"Günlük"}}]}
data: {"id":"chatcmpl_98a76","choices":[{"delta":{"content":" paketinizin"}}]}
data: {"id":"chatcmpl_98a76","choices":[{"delta":{"content":" kotası..."}}]}
data: [DONE]
2. Anthropic Messages API (Claude Code Compatible)
Fully compatible with Anthropic SDK and Claude Code CLI. System instructions are separated into a top-level <code>system</code> parameter while conversation turns reside in <code>messages</code>.
This endpoint translates the Anthropic protocol to Vangu GPT models. Use a Vangu model included in your plan; it does not provide a Claude model license. Claude Code Read, Edit, Write, Bash and MCP tools execute in the local client; tool_use and tool_result blocks are preserved on later turns.
Token counting and tool loop
<code>POST /anthropic/v1/messages/count_tokens</code> returns a provider-oriented token estimate without a charge. Image/PDF estimates are approximate; billing uses the actual response usage. <code>GET /anthropic/v1/models</code> lists models accessible to your API key.
Streams use message_start, content_block_start/delta/stop, message_delta and message_stop events. tool_choice auto, any, tool and none are supported. Return each tool result with the id of its preceding tool_use block. Parallel calls retain separate IDs; every turn uses normal quota/balance rules.
Image and document inputs, JSON schema output, max_tokens and stop_sequences are supported. thinking/effort maps to provider reasoning settings; Anthropic-signed thinking blocks are not generated. Anthropic-hosted tools and managed cache creation are not available through this bridge; use input_schema for client tools.
Anthropic Headers
| Header | Value | Required | Description |
|---|---|---|---|
| x-api-key | <API_KEY> | Yes | Vangu developer API token (`vgu_live_...`) |
| anthropic-version | 2023-06-01 | Yes | Anthropic protocol specification version |
| Content-Type | application/json | Yes | JSON body format |
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID: `gpt-5.6-sol` or `gpt-6-astra` |
| messages | array | Yes | User and assistant conversational message history |
| max_tokens | integer | Yes | Maximum output token bound (mandatory in Anthropic spec) |
| system | string | No | High-level system behavioral instruction |
| temperature | number | No | Sampling temperature (0.0 - 1.0) |
| stream | boolean | No (false) | Stream tokens via Anthropic SSE event format |
curl https://api.vangu.dev/anthropic/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: vgu_live_sample_token_67b8a901" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "gpt-5.6-sol",
"max_tokens": 1024,
"system": "Sen kıdemli bir TypeScript yazılım mimarısın.",
"messages": [
{"role": "user", "content": "Event loop ve Worker thread farkını özetle."}
]
}'
{
"id": "msg_01XyZ987654321",
"type": "message",
"role": "assistant",
"model": "gpt-5.6-sol",
"content": [
{
"type": "text",
"text": "Event Loop tek iş parçacığı üzerinde I/O operasyonlarını asenkron yönetirken, Worker Thread\'ler CPU yoğun hesaplamaları ayrı işletim sistemi iş parçacıklarına dağıtır."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 28,
"output_tokens": 36
}
}
Codex CLI / Responses API
For Codex CLI, set base_url to https://api.vangu.dev/v1 and wire_api to responses. Send model and input in the request body, and enable the OpenAI scope on your API key.
Tool support and limits
Protocol compatibility does not mean every OpenAI-hosted tool is available through the same account infrastructure. The following limits apply to the Vangu account pool.
| Feature | Status | Usage |
|---|---|---|
| function / custom | Client tools supported | The model emits calls; your application executes them and sends results on the next turn. |
| web_search | Supported through Responses | Use an allowed text model; tool_search is a separate feature. |
| tool_search / namespace | Supported through Responses | Discovers deferred client tools; it does not execute commands on the server. |
| code_interpreter / hosted shell / mcp / computer | Unsupported by the pool provider | A larger plan or quota does not enable these tools. Implement shell, Python or MCP in your client using function/custom tools. |
| file_search / vector stores | Managed service unavailable | Image file uploads do not provide vector stores or file search. |
| Responses image_generation | Not guaranteed on general text models | Use /v1/images/generations and /v1/images/edits; unsupported calls do not silently switch models. |
| previous_response_id / store:true / background:true | Unsupported | Use store:false and replay the full history on every turn. |
Forced Chat function choice uses tool_choice: {type: function, function: {name: tool_name}}. Responses uses tool_choice: {type: function, name: tool_name}. For a tool result, replay all previous response.output items in input, then append function_call_output with the same call_id. Do not use previous_response_id. On reasoning models a very small max_tokens limit can produce a length finish before answer text starts.
# Second turn after your application executes the function:
response = client.responses.create(
model="gpt-5.6-terra",
store=False,
input=[
*first_input,
*first_response.output,
{"type": "function_call_output", "call_id": call.call_id,
"output": '{"accepted": true}'}
],
tools=tools
)
curl https://api.vangu.dev/v1/responses \
-H "Authorization: Bearer YOUR_VANGU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","input":"Explain this function.","stream":true}'
3. Legacy Code Completion API
This endpoint serves legacy prompt-based completion clients. For Codex CLI and Responses clients, use https://api.vangu.dev/v1 as base_url and /v1/responses as the request path. /codex/v1/responses is not supported.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Code model ID: `gpt-5.6-sol` or `gpt-5.6-terra` |
| prompt | string | Yes | Prefix code block or function signature to complete |
| suffix | string | No | Suffix code block following cursor in FIM completions |
| max_tokens | integer | No (256) | Maximum generated code tokens |
| stop | array | No | Stop sequences where generation halts (e.g. \`["\\n}"]\`) |
curl https://api.vangu.dev/codex/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer vgu_live_sample_token_67b8a901" \
-d '{
"model": "gpt-5.6-sol",
"prompt": "function verifyHmacSignature(secret: string, payload: string, signature: string): boolean {\n",
"max_tokens": 128,
"temperature": 0.1,
"stop": ["\n}"]
}'
{
"id": "cmpl_78a1b2c3d4",
"object": "text_completion",
"created": 1788796800,
"model": "gpt-5.6-sol",
"choices": [
{
"text": " const expected = crypto.createHmac(\'sha256\', secret).update(payload).digest(\'hex\');\n return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));",
"index": 0,
"finish_reason": "stop"
}
]
}
4. Image Generation & Editing API (gpt-image-2 & 2.5)
Image generation and edits use an OpenAI-style Images schema; not all native OpenAI service fields are supported. Package calls use image allowances and balance calls use the current image tariff. Variations is a Vangu compatibility extension.
gpt-image-2.5 Modes (Flare & Sunburst)
Choose Flare for faster generation and Sunburst for detailed generation and edits. Select the exact ID or mode: flare/sunburst on gpt-image-2.5. Latency depends on the model, quality, dimensions and provider load; no fixed duration is guaranteed.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | `gpt-image-2` (standard), `gpt-image-2.5` (ultra), `gpt-image-2.5-flare`, `gpt-image-2.5-sunburst` |
| prompt | string | Yes* | Detailed textual description (*required for generations & edits, optional for variations) |
| image | file / string | Conditional | Source image file (`multipart/form-data`) or Base64 Data URL (required for `edits` and `variations`) |
| mask | file / string | No | Optional inpainting mask with transparent areas defining modification region (`edits` only) |
| mode | string | No (flare) | Mode selector for `gpt-image-2.5`: `flare` (fast) or `sunburst` (high precision & editing) |
| n | integer | No (1) | Number of images to generate (1 to 10) |
| size | string | No (auto) | `auto` or `1024x1024`, `1536x1024`, `1024x1536`. Custom edges must be multiples of 16 and at most 3840; ratio 1:3–3:1 and total 655360–8294400 pixels. |
| quality | string | No (auto) | Image 2: `auto`, `low`, `medium`, `high`. Image 2.5 also accepts `xhigh`, `max`. Vangu compatibility aliases: `standard` → `medium`, `hd` → `high`. |
| response_format | string | No (b64_json) | `url` (secure download link) or `b64_json` (base64-encoded image string) |
| output_format | string | No (png) | `png`, `jpeg`, `webp` |
1. Text-to-Image Generation (cURL & Python)
If the provider changes quality, warnings includes image_quality_changed and requested/actual values. input_fidelity and style are unsupported. Dimensions/formats may be applied to the output file; this does not guarantee higher native generation resolution. Explicitly send response_format: url for URL output.
curl https://api.vangu.dev/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer vgu_live_sample_token_67b8a901" \
-d '{
"model": "gpt-image-2.5",
"mode": "sunburst",
"prompt": "Modern bir bulut bilişim veri merkezi, mavi neon aydınlatmalar, minimalist ve sinematik 8k render",
"size": "1024x1024",
"quality": "high",
"response_format": "url",
"n": 1
}'
from openai import OpenAI
client = OpenAI(
base_url="https://api.vangu.dev/v1",
api_key="vgu_live_sample_token_67b8a901"
)
# 1. Hızlı Üretim (gpt-image-2 veya 2.5-flare)
response = client.images.generate(
model="gpt-image-2.5-flare",
prompt="Cyberpunk sokağında parlayan neon tabelalar ve yağmurlu asfalt yansımaları",
n=1,
size="1024x1024",
response_format="url"
)
print("Üretilen Görsel URL:", response.data[0].url)
2. Image Editing & Inpainting (/v1/images/edits)
Upload an existing image and edit it via textual instructions (multipart/form-data or Base64):
curl https://api.vangu.dev/v1/images/edits \
-H "Authorization: Bearer vgu_live_sample_token_67b8a901" \
-F image="@giris_resmi.png" \
-F prompt="Arka plana gün batımı ve sıcak altın tonlarında ışıklandırma ekle" \
-F model="gpt-image-2.5-sunburst" \
-F response_format="url" \
-F n="1"
from openai import OpenAI
client = OpenAI(
base_url="https://api.vangu.dev/v1",
api_key="vgu_live_sample_token_67b8a901"
)
# Görsel Düzenleme / Inpainting (Sunburst hassasiyet modu)
edited = client.images.edit(
image=open("giris_resmi.png", "rb"),
prompt="Karakterin ceketine reflektörlü neon desenler ekle",
model="gpt-image-2.5-sunburst",
n=1,
size="1024x1024",
response_format="url"
)
print("Düzenlenen Görsel:", edited.data[0].url)
Sample OpenAI-Compliant JSON Response
{
"created": 1788796800,
"data": [
{
"url": "https://assets.vangu.dev/generated/img_89a7f3e1b2c4.png",
"revised_prompt": "Minimalist cloud data center, cinematic blue lighting, hyperrealistic architectural photography"
}
]
}
5. Model Catalog and Access
GET /v1/models returns IDs allowed by your key, package/balance mode and model permissions. A model listed on the public site is not necessarily included in every plan. gpt-6-astra and gpt-6.1-sol are distinct models; neither is listed as a replacement for the other. Astra is absent if your key or package does not include it.
| Model ID | Use |
|---|---|
| gpt-6.1-terra | Visual reasoning and natural writing |
| gpt-6.1-sol | Coding, reasoning and general work |
| gpt-6-sol | Coding and general work |
| gpt-6-luna | Speed-oriented work |
| gpt-6-astra | Complex analysis; plan access required |
| gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-luna | Previous model family |
| gpt-image-2 / gpt-image-2.5 / gpt-image-2.5-flare / gpt-image-2.5-sunburst | Images endpoints; image access and allowance required |
Prices, quotas and multipliers come from your assigned package or balance tariff; this table does not imply fixed multipliers or latency. IDs absent from your list, such as gpt-5-search-api, are unavailable; use Responses web_search with an allowed text model.
curl https://api.vangu.dev/v1/models \
-H "Authorization: Bearer vgu_live_sample_token_67b8a901"
6. Error Schemas & Telemetry Headers
Vangu outputs deterministic JSON error envelopes. For daily quota limits (429), quota resets every midnight at 00:00 automatically.
OpenAI Type Error Response (429)
{
"error": {
"message": "Günlük paket kotanız doldu. Kota her gece 00.00'da sıfırlanır.",
"type": "insufficient_quota",
"code": "daily_quota_exceeded",
"reset_timestamp": 1788825600
}
}
Telemetry Headers Returned on Every Response
| Header | Example Value | Description |
|---|---|---|
| X-Vangu-Plan | daily-pro | Active subscription plan ID |
| X-RateLimit-Limit | 20000 | Total quota ceiling for active plan |
| X-RateLimit-Remaining | 18450 | Remaining requests available |
| X-RateLimit-Reset | 1788825600 | Epoch timestamp when quota resets at 00:00 midnight |
| X-Concurrency-Limit | 10 | Allowed concurrent parallel connections ceiling |
| X-Concurrency-Current | 2 | Currently active processing connections |