OpenAPI 3.1
ग्राहक API संदर्भ
यह पृष्ठ समर्थित ग्राहक inference अनुरोध और उत्तर का विवरण देता है। टूलिंग के लिए मशीन-पठनीय OpenAPI दस्तावेज़ डाउनलोड करें।
OpenAPI JSON डाउनलोड करेंमॉडल API के उदाहरण
मॉडल से उत्तर पाने का अनुरोध देखने के लिए प्रकाशित मॉडल पहचानकर्ता, API प्रोटोकॉल और भाषा चुनें। ग्राहक की API कुंजी केवल विश्वसनीय सर्वर पर रखें।
प्रोटोकॉल की आवश्यकताएँ
OpenAI-संगत अनुरोधों के लिए निर्धारित ग्राहक API आधार URL पर POST /chat/completions भेजें (डिफ़ॉल्ट https://fusionpointai.com/api/v1 है)। मॉडल से उत्तर पाने की अनुमति वाली ग्राहक कुंजी के साथ Authorization: Bearer से प्रमाणित करें। पूरा डिफ़ॉल्ट URL https://fusionpointai.com/api/v1/chat/completions है।
Claude Messages अनुरोध POST /api/v1/messages पर भेजें। ग्राहक कुंजी x-api-key में दें और anthropic-version को 2023-06-01 पर सेट करें। Anthropic SDK का आधार URL https://fusionpointai.com/api रखें, क्योंकि SDK अंत में /v1/messages जोड़ता है; Bearer प्रमाणीकरण भी समर्थित है।
समर्थित क्षमताएँ
मौजूदा OpenAI-संगत chat एंडपॉइंट समकालिक text संदेश संभालता है। इस एंडपॉइंट पर streaming और tool calls समर्थित नहीं हैं।
चुने गए upstream मॉडल के समर्थन पर Claude Messages proxy मूल content blocks, tool डेटा और वास्तविक server-sent event streaming को जस का तस आगे भेजता है।
क्लाइंट इंस्टॉल करें
Python और Node.js क्लाइंट अलग-अलग पैकेज के रूप में इंस्टॉल करें:
Python: pip install openai anthropic
Node.js: npm install openai @anthropic-ai/sdk
curl 'https://fusionpointai.com/api/v1/chat/completions' \
-H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"model": "Astra 6",
"messages": [
{
"role": "user",
"content": "Summarize this in one sentence."
}
],
"temperature": 0.7,
"max_tokens": 300
}'
अनुरोध के तरीके
API कुंजियाँ सुरक्षित रखें
मॉडल से उत्तर पाने की अनुमति वाली ग्राहक API कुंजी बनाएँ और उसे सुरक्षित रहस्य-संग्रह या सर्वर की सुरक्षित setting में रखें।
- सर्वर की सुरक्षित setting में
FUSIONPOINTAI_API_KEYरखें; कुंजी browser code में न रखें और source control में जमा न करें। - HTTPS का उपयोग करें और कुंजी को केवल उस खाते तथा मॉडल से उत्तर पाने की अनुमतियों तक सीमित रखें जिनकी अनुप्रयोग को जरूरत है।
- लॉग, अनुरोध की निगरानी से जुड़े विवरण और सहायता संदेशों से authorization तथा
x-api-keyheaders छिपाएँ; कुंजी उजागर होने की आशंका हो तो उसे रद्द करें।
export FUSIONPOINTAI_API_KEY="YOUR_CUSTOMER_API_KEY"
सटीक मॉडल पहचानकर्ता चुनें
मॉडल फ़ील्ड routing के लिए है, दिखाए जाने वाले नाम के लिए नहीं। लाइव मॉडल कैटलॉग में प्रकाशित पहचानकर्ता चुनें।
- ऐसा सक्रिय या पुराना मॉडल चुनें जिसे अनुरोध भेजने के लिए उपलब्ध दिखाया गया हो।
- विराम-चिह्न और version suffix सहित पहचानकर्ता ज्यों का त्यों कॉपी करें; मॉडल के नाम से ID न बनाएँ।
- पहचानकर्ता प्रकाशित न हो तो अनुमान लगाने के बजाय कैटलॉग में उसके आने की प्रतीक्षा करें।
model_id = "Astra 6"
# Use this exact identifier with either protocol.
सिस्टम और कई दौर के संदेश भेजें
बातचीत के संदेशों का क्रम बनाए रखें और चुने गए प्रोटोकॉल तथा मॉडल द्वारा समर्थित role और content संरचना ही भेजें।
- OpenAI-संगत अनुरोधों में system, user और assistant संदेश क्रम से string content वाली प्रविष्टियों के रूप में भेजें।
- Claude Messages में समर्थित system निर्देश और user/assistant के क्रमबद्ध संदेश प्रोटोकॉल के अपने fields में भेजें।
- केवल आवश्यक बातचीत का संदर्भ रखें और चुने मॉडल की context सीमाओं का पालन करें।
response = client.messages.create(
model="Astra 6",
max_tokens=512,
system="Answer in clear, concise German.",
messages=[
{"role": "user", "content": "What is an API?"},
{"role": "assistant", "content": "An API lets software exchange requests and responses."},
{"role": "user", "content": "Give a practical example."},
],
)
for block in response.content:
if block.type == "text":
print(block.text)
JSON उत्तर माँगें
अनुप्रयोग को तय ढाँचे में उत्तर चाहिए तो उसका उपयोग करने से पहले उसे अपने नियमों के अनुसार जाँचें।
- चुने गए प्रोटोकॉल और upstream मॉडल में उपलब्ध संरचित उत्तर के controls का उपयोग करें।
- बनाए गए JSON को अविश्वसनीय input मानें: उसे parse करें, आवश्यक fields और types जाँचें तथा अमान्य उत्तर सँभालें।
- मॉडल का दस्तावेज़ पुष्टि न करे तो यह न मानें कि उस मॉडल और प्रोटोकॉल में JSON mode उपलब्ध है।
import json
# JSON is generated content, not trusted application input.
response = client.messages.create(
model="Astra 6", max_tokens=256,
messages=[{"role": "user", "content": 'Return only JSON with a string field named "summary". Explain an API in one sentence.'}],
)
text = "".join(block.text for block in response.content if block.type == "text")
try:
result = json.loads(text)
if not isinstance(result, dict) or not isinstance(result.get("summary"), str):
raise ValueError("Unexpected response schema")
print(result["summary"])
except (json.JSONDecodeError, ValueError) as error:
print("Handle invalid model output:", error)
वास्तविक समय में SSE output पाएँ
Streaming का व्यवहार चुने गए प्रोटोकॉल और upstream मॉडल पर निर्भर है; सामान्य JSON उत्तर stream नहीं होता।
- OpenAI-संगत chat फिलहाल समकालिक text लौटाता है और streaming नहीं देता।
- Claude Messages में चुना upstream मॉडल समर्थन करे तो stream mode उपयोग करें; proxy मूल server-sent events आगे भेजता है।
- Events को आते ही पढ़ें, पूरा होने या त्रुटि पर ठीक से रुकें और अधूरे output को पूरा उत्तर न मानें।
# client is the Anthropic client configured above.
with client.messages.stream(
model="Astra 6", max_tokens=512,
messages=[{"role": "user", "content": "Explain API authentication."}],
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
final_message = stream.get_final_message()
print("\nStop reason:", final_message.stop_reason)
Tools, content blocks और त्रुटियाँ संभालें
प्रोटोकॉल की मूल संरचनाएँ बनाए रखें और tool calls, बहुरूपी content तथा विफलताओं के लिए अनुप्रयोग का व्यवहार स्पष्ट रखें।
- OpenAI-संगत chat फिलहाल tool calls या गैर-text content blocks, दोनों में से किसी का समर्थन नहीं करता।
- चुना upstream मॉडल समर्थन करे तो Claude मूल content blocks और tool-use/result डेटा बनाए रखता है; चलाने से पहले tool के नाम और arguments जाँचें।
- HTTP status और response body जाँचें, प्रमाणीकरण, अनुमति, validation और rate-limit त्रुटियों में अंतर करें, और अस्थायी त्रुटियों पर बढ़ते अंतराल के साथ फिर प्रयास करें।
import json
from datetime import datetime, timezone
from anthropic import APIError
messages = [{"role": "user", "content": "What time is it in UTC?"}]
tools = [{
"name": "current_utc_time", "description": "Read the current UTC time.",
"input_schema": {"type": "object", "properties": {}, "additionalProperties": False},
}]
try:
reply = client.messages.create(model="Astra 6", max_tokens=256, messages=messages, tools=tools)
results = []
for block in reply.content:
if block.type == "tool_use":
if block.name != "current_utc_time" or block.input != {}:
raise ValueError("Unapproved tool request")
results.append({"type": "tool_result", "tool_use_id": block.id,
"content": json.dumps({"utc": datetime.now(timezone.utc).isoformat()})})
if results:
messages.append({"role": "assistant", "content": reply.content})
messages.append({"role": "user", "content": results})
reply = client.messages.create(model="Astra 6", max_tokens=256, messages=messages, tools=tools)
print("".join(block.text for block in reply.content if block.type == "text"))
except APIError as error:
# Log status only; never log keys or private prompts.
print("API request failed:", getattr(error, "status_code", None))
अक्सर पूछे जाने वाले प्रश्न
क्या अनुरोध में मॉडल का दिखने वाला नाम दे सकता हूँ?
मॉडल से उत्तर पाने के लिए प्रकाशित सटीक पहचानकर्ता ही दें। दिखने वाला नाम routing value नहीं है; जो ID प्रकाशित नहीं है उसका अनुमान कभी न लगाएँ।
ग्राहक कुंजी सर्वर की किस setting में रखूँ?
दोनों प्रोटोकॉल के लिए FUSIONPOINTAI_API_KEY का उपयोग करें। इसका मान विश्वसनीय सर्वर पर रखें; client-side code या लॉग में नहीं।
OpenAI क्लाइंट के लिए कौन-सा URL रखें?
निर्धारित ग्राहक API आधार URL उपयोग करें; इसका डिफ़ॉल्ट https://fusionpointai.com/api/v1 है। Chat Completions endpoint में इसके बाद /chat/completions जुड़ता है।
Claude SDK का आधार URL cURL से अलग क्यों है?
Anthropic SDK अंत में /v1/messages जोड़ता है, इसलिए उसका आधार URL https://fusionpointai.com/api रखें। सीधे HTTP अनुरोध में पूरा /api/v1/messages URL दें।
क्या OpenAI-संगत chat streaming या tools देता है?
नहीं। मौजूदा endpoint केवल समकालिक text संदेश देता है; वहाँ streaming और tool calls उपलब्ध नहीं हैं।
क्या सभी Claude मॉडल में blocks, tools या streaming उपलब्ध हैं?
नहीं। चुना upstream मॉडल समर्थन करे तभी ये मूल सुविधाएँ आगे भेजी जाती हैं। उस मॉडल की क्षमताएँ जाँचें और असमर्थित अनुरोधों को संभालें।
Claude Messages · POST /messages
Claude Messages अनुरोध POST /api/v1/messages पर भेजें। ग्राहक कुंजी x-api-key में दें और anthropic-version को 2023-06-01 पर सेट करें। Anthropic SDK का आधार URL https://fusionpointai.com/api रखें, क्योंकि SDK अंत में /v1/messages जोड़ता है; Bearer प्रमाणीकरण भी समर्थित है।
चुने गए upstream मॉडल के समर्थन पर Claude Messages proxy मूल content blocks, tool डेटा और वास्तविक server-sent event streaming को जस का तस आगे भेजता है।
| फ़ील्ड | प्रकार | अनिवार्य | सीमाएँ |
|---|---|---|---|
model |
string |
हाँ | {"minLength":1,"maxLength":160} |
max_tokens |
integer |
हाँ | {"minimum":1,"maximum":100000} |
messages |
array |
हाँ | {"minItems":1,"maxItems":100,"items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","maxLength":80}},"additionalProperties":true}}]}}}} |
system |
string | array |
नहीं | {"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object","required":["type","text"],"properties":{"type":{"const":"text"},"text":{"type":"string"}},"additionalProperties":true}}]} |
stream |
boolean |
नहीं | {"default":false} |
temperature |
number |
नहीं | {"minimum":0,"maximum":1} |
top_p |
number |
नहीं | {"minimum":0,"maximum":1} |
top_k |
integer |
नहीं | {"minimum":0,"maximum":100000} |
stop_sequences |
array |
नहीं | {"items":{"type":"string"}} |
tools |
array |
नहीं | {"items":{"type":"object","additionalProperties":true}} |
tool_choice |
object |
नहीं | {"additionalProperties":true} |
thinking |
object |
नहीं | {"additionalProperties":true} |
metadata |
object |
नहीं | {"additionalProperties":true} |
output_config |
object |
नहीं | {"additionalProperties":true} |
service_tier |
string |
नहीं | [] |
{
"id": "msg_example",
"type": "message",
"role": "assistant",
"model": "Astra 6",
"content": [
{
"type": "text",
"text": "A concise answer to the supplied question."
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 10
}
}
{"type":"error","error":{"type":"authentication_error","message":"Invalid or missing API key."}}
SDK से तुरंत शुरुआत
संगत Python या Node.js क्लाइंट के साथ उत्पादन base URL इस्तेमाल करें, या cURL से वही JSON अनुरोध भेजें।
API base URL: https://fusionpointai.com/api/v1
Authorization: Bearer header में ग्राहक API कुंजी भेजें। कुंजी में ai:inference scope और सेवा के लिए खाते की पहुँच होनी चाहिए। कुंजी भरोसेमंद सर्वर पर रखें।
# Install the client for your application language.
# Python:
python -m pip install openai
# Node.js:
npm install openai
# Bash: enter the key without storing it in shell history.
read -rs -p 'FusionPointAI API key: ' FUSIONPOINTAI_API_KEY
export FUSIONPOINTAI_API_KEY
printf '\n'
# After finishing:
# unset FUSIONPOINTAI_API_KEY
curl 'https://fusionpointai.com/api/v1/chat/completions' \
-H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"model": "Jurassic-2",
"messages": [
{
"role": "user",
"content": "Summarize this in one sentence."
}
],
"temperature": 0.7,
"max_tokens": 300
}'
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["FUSIONPOINTAI_API_KEY"],
base_url="https://fusionpointai.com/api/v1",
)
response = client.chat.completions.create(
model="Jurassic-2",
messages=[{"role": "user", "content": "Summarize this in one sentence."}],
temperature=0.7,
max_tokens=300,
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.FUSIONPOINTAI_API_KEY,
baseURL: "https://fusionpointai.com/api/v1",
});
const response = await client.chat.completions.create({
model: "Jurassic-2",
messages: [{ role: "user", content: "Summarize this in one sentence." }],
temperature: 0.7,
max_tokens: 300,
});
console.log(response.choices[0].message.content);
OpenAI · अनुरोध फ़ील्ड
मॉडल मान inference के लिए मौजूदा समय में प्रकाशित सटीक पंजीकृत पहचानकर्ता हैं। कोई पहचानकर्ता प्रकाशित न हो तो अनुरोध भेजने से पहले प्रदाता कैटलॉग देखें।
| फ़ील्ड | प्रकार | अनिवार्य | सीमाएँ |
|---|---|---|---|
model | string | हाँ | अधिकतम 160 वर्ण; प्रकाशित सटीक पहचानकर्ता इस्तेमाल करें। |
messages | array | हाँ | क्रम से भेजे जाने वाले 1 से 100 संदेश। |
messages[].role | string | हाँ | system, user या assistant। |
messages[].content | string | हाँ | हर संदेश में अधिकतम 100,000 वर्ण। |
temperature | number | नहीं | 0 से 2 तक। |
max_tokens | integer | नहीं | 1 से 100,000 तक; मॉडल इससे कम सीमा लगा सकता है। |
सफल उत्तर
सफल JSON उत्तर में id, object (chat.completion), created, model और choices होते हैं। हर choice में index, assistant message और finish_reason शामिल होते हैं। Token usage भी लौटाया जा सकता है।
{
"id": "chatcmpl_example",
"object": "chat.completion",
"created": 1700000000,
"model": "Jurassic-2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "A concise summary of the supplied text."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 10,
"total_tokens": 22
}
}
| फ़ील्ड | प्रकार | अर्थ |
|---|---|---|
id | string | Completion का अद्वितीय पहचानकर्ता। |
object | string | उत्तर का प्रकार: chat.completion। |
created | integer | Unix timestamp के रूप में निर्माण का समय। |
model | string | Completion के लिए इस्तेमाल किया गया मॉडल पहचानकर्ता। |
choices | array | Assistant संदेश और समाप्ति कारण वाले completion विकल्प। |
usage | object | लौटाए जाने पर token की गिनती। |
अनुरोध सीमाएँ और त्रुटियाँ
लाइव ग्राहक सदस्यताओं में अनुरोध या token उपयोग को कोटा के विरुद्ध नहीं गिना जाता; sandbox कुंजियों पर उनकी प्रकाशित मासिक सीमा लागू होती है। मॉडल की context window, output सीमाएँ और अस्थायी traffic नियंत्रण फिर भी लागू रहते हैं। Chat Completions समकालिक text देता है; Claude Messages समर्थित मूल content blocks, tools और SSE बनाए रखता है। अनुरोध भेजने से पहले दोनों के अलग-अलग operation schemas जाँचें।
chat ऑपरेशन सत्यापन और प्रदाता विफलताओं को error object में लौटाता है। प्रमाणीकरण और scope middleware इसके बजाय सबसे ऊपरी स्तर पर message फ़ील्ड लौटा सकते हैं; उत्तर का status और envelope इस पर निर्भर करता है कि किस स्तर ने अनुरोध अस्वीकार किया।
| HTTP स्थिति | अर्थ |
|---|---|
200 | Completion सफलतापूर्वक बनाया गया। |
400 | अनुरोध की body या पैरामीटर अमान्य है। |
401 | Bearer API कुंजी नहीं दी गई या अमान्य है। |
403 | ज़रूरी key scope या खाते की पहुँच उपलब्ध नहीं है। |
429 | एप्लिकेशन अनुरोध सीमा या अस्थायी upstream ट्रैफ़िक नियंत्रण लागू हुआ; अंतराल बढ़ाकर retry करें। |
500 | सेवा उपयोग योग्य completion नहीं लौटा सकी। |
OpenAPI JSON डाउनलोड करें
{
"openapi": "3.1.0",
"info": {
"title": "FusionPointAI Customer API",
"version": "1.0.0",
"description": "OpenAI-compatible synchronous text Chat Completions and native Claude Messages. Use https://fusionpointai.com/api/v1 as the production HTTP base URL. Claude SDKs use the base without /v1 because they append /v1/messages. Model capabilities, subscription permissions and technical limits still apply. Native streaming and content blocks belong to the Messages operation, not Chat Completions."
},
"servers": [
{
"url": "https://fusionpointai.com/api/v1",
"description": "FusionPointAI Production API"
}
],
"security": [
{
"bearerAuth": []
}
],
"tags": [
{
"name": "Inference",
"description": "Synchronous JSON chat completion"
}
],
"x-rateLimitPolicy": {
"type": "unmetered_subscription",
"summary": "Live subscriptions do not meter request or token usage against a quota; sandbox keys use their published monthly allowance.",
"technical_constraints": "Model context windows, maximum output sizes, and temporary traffic controls may still apply according to the selected model or upstream provider."
},
"x-errorReference": [
{
"status": 200,
"description": "The completion was created successfully."
},
{
"status": 400,
"description": "The request body or one of its parameters is invalid."
},
{
"status": 401,
"description": "The bearer API key is missing or invalid."
},
{
"status": 403,
"description": "The key lacks the required inference scope or account access."
},
{
"status": 429,
"description": "The request was limited by application throttling or an upstream provider."
},
{
"status": 500,
"description": "The service could not complete the request."
}
],
"paths": {
"/chat/completions": {
"post": {
"tags": [
"Inference"
],
"summary": "Create a chat completion",
"operationId": "createChatCompletion",
"description": "Create a synchronous JSON completion. Messages support system, user, and assistant roles with string content. Use the separate Messages operation for native Claude content blocks and SSE.",
"security": [
{
"bearerAuth": []
}
],
"x-codeSamples": [
{
"lang": "cURL",
"label": "cURL",
"source": "curl 'https://fusionpointai.com/api/v1/chat/completions' \\\n -H \"Authorization: Bearer $FUSIONPOINTAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"Jurassic-2\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Summarize this in one sentence.\"\n }\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 300\n}'"
},
{
"lang": "Python",
"label": "Python",
"source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ[\"FUSIONPOINTAI_API_KEY\"],\n base_url=\"https://fusionpointai.com/api/v1\",\n)\n\nresponse = client.chat.completions.create(\n model=\"Jurassic-2\",\n messages=[{\"role\": \"user\", \"content\": \"Summarize this in one sentence.\"}],\n temperature=0.7,\n max_tokens=300,\n)\nprint(response.choices[0].message.content)"
},
{
"lang": "Node.js",
"label": "Node.js",
"source": "import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n apiKey: process.env.FUSIONPOINTAI_API_KEY,\n baseURL: \"https://fusionpointai.com/api/v1\",\n});\n\nconst response = await client.chat.completions.create({\n model: \"Jurassic-2\",\n messages: [{ role: \"user\", content: \"Summarize this in one sentence.\" }],\n temperature: 0.7,\n max_tokens: 300,\n});\nconsole.log(response.choices[0].message.content);"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChatCompletionRequest"
}
}
}
},
"responses": {
"200": {
"description": "Completion created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChatCompletionResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorised"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/ServerError"
}
}
}
},
"/messages": {
"post": {
"tags": [
"Inference"
],
"summary": "Create a Claude Messages response",
"operationId": "createMessage",
"description": "Native Messages format. The model must support the requested content blocks, tools and streaming options. The gateway forwards provider-native JSON or real SSE without translating it into Chat Completions. A configured native upstream is required. Maximum JSON request size: 12 MiB.",
"security": [
{
"claudeApiKey": []
},
{
"bearerAuth": []
}
],
"parameters": [
{
"in": "header",
"name": "anthropic-version",
"schema": {
"type": "string",
"maxLength": 64
},
"example": "2023-06-01"
},
{
"in": "header",
"name": "anthropic-beta",
"schema": {
"type": "string",
"maxLength": 512
}
}
],
"x-codeSamples": [
{
"lang": "cURL",
"label": "cURL",
"source": "curl 'https://fusionpointai.com/api/v1/messages' \\\n -H \"x-api-key: $FUSIONPOINTAI_API_KEY\" \\\n -H \"anthropic-version: 2023-06-01\" \\\n -H \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"Jurassic-2\",\n \"max_tokens\": 300,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Summarize this in one sentence.\"\n }\n ]\n}'"
},
{
"lang": "Python",
"label": "Python",
"source": "import os\nfrom anthropic import Anthropic\n\nclient = Anthropic(\n api_key=os.environ[\"FUSIONPOINTAI_API_KEY\"],\n base_url=\"https://fusionpointai.com/api\",\n)\n\nresponse = client.messages.create(\n model=\"Jurassic-2\",\n max_tokens=300,\n messages=[{\"role\": \"user\", \"content\": \"Summarize this in one sentence.\"}],\n)\nprint(response.content)"
},
{
"lang": "Node.js",
"label": "Node.js",
"source": "import Anthropic from \"@anthropic-ai/sdk\";\n\nconst client = new Anthropic({\n apiKey: process.env.FUSIONPOINTAI_API_KEY,\n baseURL: \"https://fusionpointai.com/api\",\n});\n\nconst response = await client.messages.create({\n model: \"Jurassic-2\",\n max_tokens: 300,\n messages: [{ role: \"user\", content: \"Summarize this in one sentence.\" }],\n});\nconsole.log(response.content);"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeMessagesRequest"
}
}
}
},
"responses": {
"200": {
"description": "Native message or incremental native SSE events.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeMessage"
}
},
"text/event-stream": {
"schema": {
"type": "string",
"description": "message_start, content_block_start/delta/stop, message_delta/stop and provider error events as delivered upstream."
}
}
}
},
"201": {
"description": "Invalid JSON, message structure, field type or bounds.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeError"
}
}
}
},
"202": {
"description": "Missing, invalid, conflicting or query-string credentials.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeError"
}
}
}
},
"203": {
"description": "Scope, account or training-reference permission denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeError"
}
}
}
},
"204": {
"description": "Request exceeds 12 MiB.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeError"
}
}
}
},
"205": {
"description": "Application or upstream rate limit.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeError"
}
}
}
},
"206": {
"description": "Inference provider or service failure.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeError"
}
}
}
},
"207": {
"description": "Inference provider or service failure.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeError"
}
}
}
},
"208": {
"description": "Native upstream or server credentials are not configured.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeError"
}
}
}
},
"209": {
"description": "Upstream overloaded.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClaudeError"
}
}
}
}
}
}
}
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "API key"
},
"claudeApiKey": {
"type": "apiKey",
"in": "header",
"name": "x-api-key"
}
},
"schemas": {
"ChatCompletionRequest": {
"type": "object",
"required": [
"model",
"messages"
],
"properties": {
"model": {
"type": "string",
"maxLength": 160,
"enum": [
"Jurassic-2",
"Claude Fable 5.1",
"claude-opus-5-5",
"claude-sonnet-5-5",
"claude-haiku-5-5",
"Claude Opus 5",
"Claude Fable 5",
"Claude Mythos 5",
"Claude Sonnet 5",
"Claude Opus 4.8",
"Claude Haiku 4.5",
"command-a-plus-05-2026",
"command-a-reasoning-08-2025",
"command-a-vision-07-2025",
"command-a-translate-08-2025",
"embed-v5.0-pro",
"embed-v5.0-fast",
"rerank-v5.0-pro",
"rerank-v5.0-fast",
"Command R",
"Command R+",
"Embed",
"Rerank",
"deepseek-flash",
"DeepSeek V4",
"GLM-5.3",
"glm-5.3-flashx",
"GLM-5.3 Flash",
"GLM-4.7",
"kimi-k3.1-pro",
"kimi-k3.1-pro-highspeed",
"Kimi K3",
"Kimi K2.7 Code",
"Kimi K2.6",
"Kimi K2.5",
"Astra 6",
"gpt-6.1-sol",
"gpt-6.1-terra",
"gpt-6-luna",
"GPT-5.6 Sol",
"GPT-5.6 Terra",
"GPT-5.6 Luna",
"GPT-5.5",
"GPT-5.4",
"GPT-5.4 mini",
"GPT-5.4 nano",
"qwen3.8-max",
"qwen3.8-flash",
"qwen3.8-omni-flash",
"qwen3.7-plus",
"Qwen3.8",
"Qwen3 Coder Next",
"Qwen3-VL"
],
"description": "An exact registered model identifier currently published for inference."
},
"messages": {
"type": "array",
"minItems": 1,
"maxItems": 100,
"items": {
"$ref": "#/components/schemas/ChatMessage"
}
},
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 2
},
"max_tokens": {
"type": "integer",
"minimum": 1,
"maximum": 100000,
"description": "The selected model may impose a lower output limit."
}
}
},
"ChatMessage": {
"type": "object",
"required": [
"role",
"content"
],
"properties": {
"role": {
"type": "string",
"enum": [
"system",
"user",
"assistant"
]
},
"content": {
"type": "string",
"maxLength": 100000
}
}
},
"ChatCompletionResponse": {
"type": "object",
"required": [
"id",
"object",
"model",
"choices"
],
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string",
"example": "chat.completion"
},
"created": {
"type": "integer"
},
"model": {
"type": "string"
},
"choices": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ChatChoice"
}
},
"usage": {
"$ref": "#/components/schemas/TokenUsage"
}
}
},
"ChatChoice": {
"type": "object",
"properties": {
"index": {
"type": "integer"
},
"message": {
"$ref": "#/components/schemas/ChatMessage"
},
"finish_reason": {
"type": [
"string",
"null"
]
}
}
},
"TokenUsage": {
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer"
},
"completion_tokens": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
}
}
},
"Error": {
"oneOf": [
{
"$ref": "#/components/schemas/OperationError"
},
{
"$ref": "#/components/schemas/MiddlewareError"
}
]
},
"OperationError": {
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"message",
"type",
"code"
],
"properties": {
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"code": {
"type": [
"string",
"integer",
"null"
]
},
"details": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"MiddlewareError": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
},
"additionalProperties": true
},
"ClaudeMessagesRequest": {
"type": "object",
"required": [
"model",
"max_tokens",
"messages"
],
"properties": {
"model": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"enum": [
"Jurassic-2",
"Claude Fable 5.1",
"claude-opus-5-5",
"claude-sonnet-5-5",
"claude-haiku-5-5",
"Claude Opus 5",
"Claude Fable 5",
"Claude Mythos 5",
"Claude Sonnet 5",
"Claude Opus 4.8",
"Claude Haiku 4.5",
"command-a-plus-05-2026",
"command-a-reasoning-08-2025",
"command-a-vision-07-2025",
"command-a-translate-08-2025",
"embed-v5.0-pro",
"embed-v5.0-fast",
"rerank-v5.0-pro",
"rerank-v5.0-fast",
"Command R",
"Command R+",
"Embed",
"Rerank",
"deepseek-flash",
"DeepSeek V4",
"GLM-5.3",
"glm-5.3-flashx",
"GLM-5.3 Flash",
"GLM-4.7",
"kimi-k3.1-pro",
"kimi-k3.1-pro-highspeed",
"Kimi K3",
"Kimi K2.7 Code",
"Kimi K2.6",
"Kimi K2.5",
"Astra 6",
"gpt-6.1-sol",
"gpt-6.1-terra",
"gpt-6-luna",
"GPT-5.6 Sol",
"GPT-5.6 Terra",
"GPT-5.6 Luna",
"GPT-5.5",
"GPT-5.4",
"GPT-5.4 mini",
"GPT-5.4 nano",
"qwen3.8-max",
"qwen3.8-flash",
"qwen3.8-omni-flash",
"qwen3.7-plus",
"Qwen3.8",
"Qwen3 Coder Next",
"Qwen3-VL"
]
},
"max_tokens": {
"type": "integer",
"minimum": 1,
"maximum": 100000
},
"messages": {
"type": "array",
"minItems": 1,
"maxItems": 100,
"items": {
"type": "object",
"required": [
"role",
"content"
],
"properties": {
"role": {
"type": "string",
"enum": [
"user",
"assistant"
]
},
"content": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"maxLength": 80
}
},
"additionalProperties": true
}
}
]
}
}
}
},
"system": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"text"
],
"properties": {
"type": {
"const": "text"
},
"text": {
"type": "string"
}
},
"additionalProperties": true
}
}
]
},
"stream": {
"type": "boolean",
"default": false
},
"temperature": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"top_p": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"top_k": {
"type": "integer",
"minimum": 0,
"maximum": 100000
},
"stop_sequences": {
"type": "array",
"items": {
"type": "string"
}
},
"tools": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"tool_choice": {
"type": "object",
"additionalProperties": true
},
"thinking": {
"type": "object",
"additionalProperties": true
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"output_config": {
"type": "object",
"additionalProperties": true
},
"service_tier": {
"type": "string"
}
},
"additionalProperties": true
},
"ClaudeMessage": {
"type": "object",
"required": [
"type",
"content"
],
"properties": {
"id": {
"type": "string"
},
"type": {
"const": "message"
},
"role": {
"const": "assistant"
},
"content": {
"type": "array",
"items": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"maxLength": 80
}
},
"additionalProperties": true
}
},
"model": {
"type": "string"
},
"stop_reason": {
"type": [
"string",
"null"
]
},
"usage": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer"
},
"output_tokens": {
"type": "integer"
}
},
"additionalProperties": true
}
},
"additionalProperties": true
},
"ClaudeError": {
"type": "object",
"required": [
"type",
"error"
],
"properties": {
"type": {
"const": "error"
},
"error": {
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"type": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
}
}
},
"responses": {
"BadRequest": {
"description": "Invalid request body or parameter.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"Unauthorised": {
"description": "Missing or invalid bearer API key.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"Forbidden": {
"description": "The key lacks the required inference scope or account access.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"RateLimited": {
"description": "Application throttle or temporary upstream traffic control.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"ServerError": {
"description": "The service could not return a usable completion.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}