Skip to main content
POST
cURL
OpenAI-compatible Chat Completions को POST https://bettertoken.ai/v1/chat/completions से कॉल करें। अधिकतर external tools Base URL https://bettertoken.ai/v1 लेते हैं और /chat/completions स्वयं जोड़ते हैं।

मुख्य सेटिंग्स

आवश्यकताएं

इंस्टॉल करें

curl के लिए SDK नहीं चाहिए। पुष्टि करें कि curl --version आपके terminal में चलता है।

मैन्युअल सेटअप

curl

Python SDK

JavaScript SDK

कनेक्शन सत्यापित करें

दाईं ओर Playground में:
  1. Authorization के अंतर्गत YOUR_API_KEY भरें।
  2. model को YOUR_MODEL_ID से बदलें।
  3. messages संपादित करें और अनुरोध भेजें।
Playground पहले से पूरा URL https://bettertoken.ai/v1/chat/completions उपयोग करता है। मॉडल output के साथ 200 response का choices[0].message.content में होना कनेक्शन की पुष्टि करता है।

मॉडल बदलें

YOUR_MODEL_ID को model plaza या Setup dialog की पूरी Model ID से बदलें। display name के आधार पर Model ID को छोटा न करें।

सामान्य त्रुटियां

उन्नत सेटअप

समर्थित provider

ये स्थितियां केवल इस पेज पर बताए गए BetterToken सेटअप पर लागू होती हैं।
  • मैन्युअल सेटअप: API Key, Base URL और Model दर्ज करें।
  • समर्थित नहीं: सीधे सेटअप का कोई सत्यापित तरीका अभी उपलब्ध नहीं है।

तकनीकी विवरण

पूरा request URL मांगने वाले tool, जैसे GitHub Copilot और TRAE, https://bettertoken.ai/v1/chat/completions उपयोग करते हैं। path स्वयं जोड़ने वाले tool, जैसे Cursor, Cline, OpenCode, n8n और Dify, केवल https://bettertoken.ai/v1 उपयोग करते हैं।

प्राधिकरण

Authorization
string
header
आवश्यक

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

बॉडी

application/json
model
string
आवश्यक

A model ID currently available from a GPT provider. Check the model plaza for the latest options.

उदाहरण:

"YOUR_MODEL_ID"

messages
object[]
आवश्यक

Conversation messages. Each item should contain role and content.

Minimum array length: 1
stream
boolean
डिफ़ॉल्ट:false

Whether to request a streaming response.

प्रतिक्रिया

The Chat Completions result from the selected model.