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 प्रारूप)
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!"}]
}'base_url और key सेट करें — Integrationssection देखें।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!"
}'टोकन गणना: 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 }messages और system bodies वैसे ही pass किए जाते हैं जैसे Anthropic API में।