इसे छोड़कर कंटेंट पर जाएं
मुफ़्त साइन अप करें
API संदर्भ

Anthropic Messages API गाइड

BetterToken के Anthropic-compatible Messages API का परीक्षण करें: x-api-key, anthropic-version और POST /v1/messages।

POST /v1/messages

इस endpoint का उपयोग Claude Code, Anthropic SDK और Anthropic Messages API इस्तेमाल करने वाले application के लिए करें।

Playground में परीक्षण

दाईं ओर Playground में x-api-key फ़ील्ड में API Key भरें, anthropic-version को 2023-06-01 ही रहने दें, उपलब्ध मॉडल चुनें और अनुरोध भेजें।

संबंधित endpoint

POST/v1/messages

प्राधिकरण

x-api-keystringheaderआवश्यक

हेडर

anthropic-versionstringडिफ़ॉल्ट: 2023-06-01आवश्यक

The Anthropic API version header.

उदाहरण:"2023-06-01"

बॉडी application/json

modelstringआवश्यक

A model ID currently available in the model plaza. Check the model plaza for the latest options.

उदाहरण:"YOUR_MODEL_ID"
max_tokensintegerडिफ़ॉल्ट: 1024आवश्यक

The maximum number of tokens to generate in the response.

आवश्यक सीमा: x >= 1

उदाहरण:1024
messagesobject[]आवश्यक

Messages in Anthropic format. Each item should contain role and content.

Minimum array length: 1

Show child attributes
messages[].rolestringआवश्यक
उदाहरण:"user"
messages[].contentstringआवश्यक
उदाहरण:"Hello"

प्रतिक्रिया

200The Anthropic Messages result from the selected model.
400Invalid request format or parameters.
401The BetterToken API Key is missing or invalid.
402The account has insufficient credit or balance.
429The request exceeded a rate or concurrency limit, or the upstream service is busy.
500The gateway or upstream service returned an error.