
Assisters uses API keys for authentication. Include your key in every request via the Authorization header using the Bearer scheme.
curl https://api.assisters.com/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
/v1/keys { "name": "dev-key-01" }
/v1/keys/{key_id} then create a new one.HTTP 429.List available AI models and their capabilities.
Request
GET /v1/models
Response
{
"models": [
{
"id": "gpt-4.1-mini",
"name": "GPT-4.1 Mini",
"max_tokens": 128000,
"supports": ["chat", "embeddings", "reasoning"]
}
]
}
Use Case: Select a model based on token limits or supported features.
Generate AI responses for chat interactions.
Request
POST /v1/chat/completions
Body
{
"model": "gpt-4.1-mini",
"messages": [
{ "role": "user", "content": "Explain quantum computing." }
],
"temperature": 0.7,
"max_tokens": 1000
}
Response
{
"choices": [
{
"message": {
"role": "assistant",
"content": "Quantum computing..."
}
}
]
}
Parameters
model: Required. Specify the model ID.messages: Required. Array of { role, content } pairs (e.g., user, assistant).temperature: Float (0–1). Lower = more deterministic.max_tokens: Integer. Maximum response length.Streaming Responses
Set stream: true to receive chunks as they’re generated.
fetch("https://api.assisters.com/v1/chat/completions", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ model: "gpt-4.1-mini", messages: [{ role: "user", content: "Hello" }], stream: true })
});
Convert text into vector embeddings for semantic search or clustering.
Request
POST /v1/embeddings
Body
{
"model": "text-embedding-3-small",
"input": "The quick brown fox jumps over the lazy dog."
}
Response
{
"embedding": [0.0012, -0.0045, ..., 0.0078],
"model": "text-embedding-3-small",
"usage": { "tokens": 12 }
}
Use Cases
Extend chat completions with function calling for real-world integrations.
Request
{
"model": "gpt-4.1-mini",
"messages": [{ "role": "user", "content": "What’s the weather in Paris?" }],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": { "type": "string" }
}
}
}
}
]
}
Response
{
"choices": [{
"message": {
"role": "assistant",
"content": null,
"tool_calls": [{
"id": "call_123",
"type": "function",
"function": { "name": "get_weather", "arguments": "{\"location\": \"Paris\"}" }
}]
}
}]
}
Handling Tool Calls
tool_calls array. {
"role": "tool",
"content": "{\"temperature\": 15, \"unit\": \"C\"}",
"tool_call_id": "call_123"
}
Supported Tools
web_search: Real-time web search.code_interpreter: Execute Python code.tools parameter.Enable step-by-step problem-solving for complex queries.
Request
{
"model": "gpt-4.1-mini",
"messages": [{ "role": "user", "content": "Solve 2x + 3 = 7." }],
"reasoning": true,
"max_tokens": 2000
}
Response
{
"choices": [{
"message": {
"role": "assistant",
"content": "Step 1: Subtract 3 from both sides → 2x = 4.
Step 2: Divide by 2 → x = 2.",
"reasoning": "Derived from algebraic manipulation."
}
}]
}
Use Cases
Assisters uses standard HTTP status codes. Key errors:
| Code | Error Type | Example |
|---|---|---|
| 400 | Bad Request | Missing model parameter. |
| 401 | Unauthorized | Invalid API key. |
| 404 | Not Found | Unknown model ID. |
| 429 | Too Many Requests | Rate limit exceeded. |
| 500 | Internal Server Error | Model inference failed. |
Error Response Format
{
"error": {
"type": "invalid_request_error",
"message": "Model not found.",
"param": "model",
"code": "model_not_found"
}
}
Retry Logic
429, implement exponential backoff (e.g., 1s, 2s, 4s).500, retry up to 3 times with jitter (e.g., +0.5s).pip install assistents from assistents import Assisters
client = Assisters(api_key="YOUR_KEY")
response = client.chat.completions.create(model="gpt-4.1-mini", messages=[{"role": "user", "content": "Hello"}])
print(response.choices[0].message.content)
npm install @assisters/sdk import Assisters from '@assisters/sdk';
const client = new Assisters({ apiKey: "YOUR_KEY" });
const response = await client.chat.completions.create({ model: "gpt-4.1-mini", messages: [{ role: "user", content: "Hello" }] });
console.log(response.choices[0].message.content);
github.com/assisters/go-sdkgem assistents-rubySubscribe to real-time events (e.g., chat completions, errors).
Setup
/v1/webhooks {
"url": "https://your-server.com/events",
"events": ["chat.completion", "model.failed"]
}
GET /webhooks/verify with a challenge token. {
"event": "chat.completion",
"data": { "id": "chat_123", "status": "completed" }
}
Security
from cachetools import cached, TTLCache
cache = TTLCache(maxsize=1000, ttl=3600)
@cached(cache)
def get_embedding(text):
response = client.embeddings.create(model="text-embedding-3-small", input=text)
return response.embedding
{
"model": "text-embedding-3-small",
"input": ["text 1", "text 2", "text 3"]
}
gpt-4.1-mini instead of gpt-4.1-ultra).DELETE /v1/data/{id}.mask: true in requests to redact personally identifiable information.Access logs via GET /v1/audit?start=2024-01-01&end=2024-01-31.
/v1/completions → /v1/chat/completionsprompt with messages array: - { "prompt": "Hello" }
+ { "messages": [{ "role": "user", "content": "Hello" }] }
gpt-4.1-mini instead of gpt-3.5-turbo).temperature now defaults to 1.0 (was 0.5).max_tokens includes response tokens (previously excluded).idempotency-key header for retries: POST /v1/chat/completions
Idempotency-Key: abc123
/v1/metrics./v1/models/{model}/test for canary deployments.Assisters’ API empowers you to integrate AI seamlessly into your applications, whether you’re building chatbots, search engines, or automation tools. By leveraging the endpoints, tools, and optimizations outlined here, you can reduce development time from weeks to minutes while ensuring scalability and reliability. Start with the quickstart guide and experiment with the interactive playground to see what’s possible. The future of AI-assisted development is here—build it today.
When building applications that require intelligent assistance—whether for customer support, internal workflows, or user-facing features—cho…

Git is the silent backbone of modern software development—a system so fundamental that we often take it for granted until something breaks.…
Developers building AI assistants today face a critical choice: which AI Assistant SDK will help them embed, train, and ship faster? The rig…

Comments
Sign in to join the conversation
No comments yet. Be the first to share your thoughts!