Messages (Anthropic) और Responses

/v1/messages (Anthropic प्रारूप, x-api-key) और /v1/responses — Claude Code और Codex CLI के पथ। एक base_url getvibeapi.com/v1, एक कुंजी।

/v1/chat/completions के अलावा, anthropic-format और Responses endpoints भी उपलब्ध हैं — Claude Code और Codex CLI के लिए। तीनों एक ही base address और एक ही key sk-pv-… साझा करते हैं।

संदेश (Anthropic प्रारूप)

POSThttps://getvibeapi.com/v1/messages

x-api-key: sk-pv-… header से authorize करें (जैसे Anthropic API में)। Body Messages format में है: model, max_tokens, messages। SSE streaming समर्थित है।

curl https://getvibeapi.com/v1/messages \
  -H "x-api-key: $GETVIBE_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-5.5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
यह Claude Code का path है: हमारा base_url और key सेट करें — Integrationssection देखें।

Responses

POSThttps://getvibeapi.com/v1/responses

Responses endpoint (OpenAI Responses API format) — Codex CLI का रास्ता। Authorization Authorization: Bearer sk-pv-…।

Server-side conversation state समर्थित नहीं है: previous_response_id पिछली request को आगे नहीं बढ़ाता, और store फ़ील्ड को नज़रअंदाज़ किया जाता है। हर request के input फ़ील्ड में पूरी conversation history भेजें।

curl https://getvibeapi.com/v1/responses \
  -H "Authorization: Bearer $GETVIBE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.1-sol",
    "input": "Hello!"
  }'
GetVibe compatible Messages और Responses bodies स्वीकार करता है, लेकिन pass-through का वादा नहीं करता: public ids और supported fields normalize किए जा सकते हैं, और internal response fields तथा errors को public contract में mapped किया जाता है।

टोकन गणना: count_tokens

POSThttps://getvibeapi.com/v1/messages/count_tokens

Anthropic SDK और Claude Code के साथ compatibility के लिए एक stub endpoint: input token count का अनुमान लगाने के लिए वे request भेजने से पहले इसे स्वतः call करते हैं। उसी key sk-pv-… से x-api-key या Authorization: Bearer में authorize करें।

curl https://getvibeapi.com/v1/messages/count_tokens \
  -H "x-api-key: $GETVIBE_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-5.5",
    "messages": [{"role": "user", "content": "Hello! Who are you?"}]
  }'
{ "input_tokens": 6 }
Counter एक heuristic estimate है (~4 characters per token), सटीक tokenizer नहीं। यह limits को request से पहले जाँचने के लिए काफ़ी है। messages और system bodies वैसे ही pass किए जाते हैं जैसे Anthropic API में।
GetVibe API Messages और Responses — Claude Code, Codex | GetVibe API