Base URL: https://api.nexusapi.org/v1
All requests must include your API key in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Generate chat completions from AI models.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID (gpt-4o, claude-3-opus, etc) |
messages | array | Yes | Array of message objects |
temperature | number | No | 0-2, default 1 |
max_tokens | integer | No | Max tokens to generate |
stream | boolean | No | Enable streaming |
curl https://api.nexusapi.org/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}]
}'
List all available models.
Get specific model information.
Generate vector embeddings for text.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Embedding model ID |
input | string/array | Yes | Text to embed |
pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://api.nexusapi.org/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad Request |
401 | Invalid API Key |
429 | Rate Limit Exceeded |
500 | Server Error |
base_url to https://api.nexusapi.org/v1.