VANGU / DEVELOPER

Endpoints & Parameter Reference

Complete payload, header and telemetry specifications across all supported protocols.

POST /v1/chat/completions POST /anthropic/v1/messages POST /v1/responses POST /codex/v1/completions POST /v1/images/generations GET /v1/models HTTP Hata & Telemetri
POST https://api.vangu.dev/v1/chat/completions

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

HeaderValueRequiredDescription
AuthorizationBearer <API_KEY>YesYour Vangu API developer token (`vgu_live_...`)
Content-Typeapplication/jsonYesJSON body format

Request Body Parameters

ParameterTypeRequiredDescription
modelstringYesAn 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.
messagesarrayYesArray of role and content objects
temperaturenumberNo (0.7)Sampling randomness between 0.0 and 2.0
max_tokensintegerNoUpper bound limit for generated tokens
streambooleanNo (false)Stream tokens via Server-Sent Events
response_formatobjectNoEnforce structured JSON output via `{"type": "json_object"}`
toolsarrayNoFunction definitions the model may invoke

Sample Request & Response

BASH / cURL
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
  }'

JSON Response
{
  "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:

Server-Sent Events (SSE)
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]

POST https://api.vangu.dev/anthropic/v1/messages

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

HeaderValueRequiredDescription
x-api-key<API_KEY>YesVangu developer API token (`vgu_live_...`)
anthropic-version2023-06-01YesAnthropic protocol specification version
Content-Typeapplication/jsonYesJSON body format

Request Body Parameters

ParameterTypeRequiredDescription
modelstringYesModel ID: `gpt-5.6-sol` or `gpt-6-astra`
messagesarrayYesUser and assistant conversational message history
max_tokensintegerYesMaximum output token bound (mandatory in Anthropic spec)
systemstringNoHigh-level system behavioral instruction
temperaturenumberNoSampling temperature (0.0 - 1.0)
streambooleanNo (false)Stream tokens via Anthropic SSE event format
BASH / cURL
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."}
    ]
  }'

JSON Anthropic Response
{
  "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
  }
}

POSThttps://api.vangu.dev/v1/responses

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.

FeatureStatusUsage
function / customClient tools supportedThe model emits calls; your application executes them and sends results on the next turn.
web_searchSupported through ResponsesUse an allowed text model; tool_search is a separate feature.
tool_search / namespaceSupported through ResponsesDiscovers deferred client tools; it does not execute commands on the server.
code_interpreter / hosted shell / mcp / computerUnsupported by the pool providerA larger plan or quota does not enable these tools. Implement shell, Python or MCP in your client using function/custom tools.
file_search / vector storesManaged service unavailableImage file uploads do not provide vector stores or file search.
Responses image_generationNot guaranteed on general text modelsUse /v1/images/generations and /v1/images/edits; unsupported calls do not silently switch models.
previous_response_id / store:true / background:trueUnsupportedUse 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.

Python / stateless tool-result history
# 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
)

BASH / cURL
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}'

POST https://api.vangu.dev/codex/v1/completions

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.

ParameterTypeRequiredDescription
modelstringYesCode model ID: `gpt-5.6-sol` or `gpt-5.6-terra`
promptstringYesPrefix code block or function signature to complete
suffixstringNoSuffix code block following cursor in FIM completions
max_tokensintegerNo (256)Maximum generated code tokens
stoparrayNoStop sequences where generation halts (e.g. \`["\\n}"]\`)
BASH / cURL
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}"]
  }'

JSON Codex Response
{
  "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"
    }
  ]
}

POST /v1/images/generations /v1/images/edits /v1/images/variations

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.

ParameterTypeRequiredDescription
modelstringYes`gpt-image-2` (standard), `gpt-image-2.5` (ultra), `gpt-image-2.5-flare`, `gpt-image-2.5-sunburst`
promptstringYes*Detailed textual description (*required for generations & edits, optional for variations)
imagefile / stringConditionalSource image file (`multipart/form-data`) or Base64 Data URL (required for `edits` and `variations`)
maskfile / stringNoOptional inpainting mask with transparent areas defining modification region (`edits` only)
modestringNo (flare)Mode selector for `gpt-image-2.5`: `flare` (fast) or `sunburst` (high precision & editing)
nintegerNo (1)Number of images to generate (1 to 10)
sizestringNo (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.
qualitystringNo (auto)Image 2: `auto`, `low`, `medium`, `high`. Image 2.5 also accepts `xhigh`, `max`. Vangu compatibility aliases: `standard` → `medium`, `hd` → `high`.
response_formatstringNo (b64_json)`url` (secure download link) or `b64_json` (base64-encoded image string)
output_formatstringNo (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.

BASH / cURL
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
  }'

Python (OpenAI SDK)
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 (Multipart / Form-Data)
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"

Python (OpenAI SDK - Edits)
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

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"
    }
  ]
}

GET https://api.vangu.dev/v1/models

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 IDUse
gpt-6.1-terraVisual reasoning and natural writing
gpt-6.1-solCoding, reasoning and general work
gpt-6-solCoding and general work
gpt-6-lunaSpeed-oriented work
gpt-6-astraComplex analysis; plan access required
gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-lunaPrevious model family
gpt-image-2 / gpt-image-2.5 / gpt-image-2.5-flare / gpt-image-2.5-sunburstImages 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.

BASH / cURL
curl https://api.vangu.dev/v1/models \
  -H "Authorization: Bearer vgu_live_sample_token_67b8a901"

HTTP Error Schemas &amp; Telemetry Headers

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)

JSON 429 Error
{
  "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

HeaderExample ValueDescription
X-Vangu-Plandaily-proActive subscription plan ID
X-RateLimit-Limit20000Total quota ceiling for active plan
X-RateLimit-Remaining18450Remaining requests available
X-RateLimit-Reset1788825600Epoch timestamp when quota resets at 00:00 midnight
X-Concurrency-Limit10Allowed concurrent parallel connections ceiling
X-Concurrency-Current2Currently active processing connections