Get Started with Assisters
Start building with Assisters APIs in under 5 minutes. This guide will walk you through authentication, making your first API call, and best practices.
Get Your API Key
First, you'll need an API key to authenticate your requests.
- Sign up for an account at assisters.dev/signup
- Navigate to the API Keys page in your dashboard
- Click "Create API Key" and give it a descriptive name
- Copy your key (it will only be shown once)
Keep your API key secure
Never share your API key or commit it to version control. Use environment variables to store it securely.
Make Your First Request
Let's make a simple chat completion request using cURL:
curl https://api.assisters.dev/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "assisters-chat-v1",
"messages": [
{
"role": "user",
"content": "Explain quantum computing in simple terms"
}
]
}'You'll receive a response like this:
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1704067200,
"model": "assisters-chat-v1",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing uses quantum mechanics..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 15,
"completion_tokens": 120,
"total_tokens": 135
}
}Use in Your Code
Integrate Assisters into your application using your preferred language:
Python
import os
from assisters import Assisters
# Initialize the client
client = Assisters(api_key=os.environ.get("ASSISTERS_API_KEY"))
# Create a chat completion
response = client.chat.completions.create(
model="assisters-chat-v1",
messages=[
{"role": "user", "content": "Hello, how are you?"}
]
)
# Print the response
print(response.choices[0].message.content)Node.js
import Assisters from 'assisters';
const client = new Assisters({
apiKey: process.env.ASSISTERS_API_KEY
});
async function main() {
const response = await client.chat.completions.create({
model: 'assisters-chat-v1',
messages: [
{ role: 'user', content: 'Hello, how are you?' }
]
});
console.log(response.choices[0].message.content);
}
main();Next Steps
Best Practices
Use environment variables
Store your API key in environment variables, never hardcode it in your source code.
Handle errors gracefully
Implement proper error handling and retry logic for production applications.
Monitor your usage
Check your dashboard regularly to track API usage and costs.
Start with smaller models
Use efficient models like Assisters Chat v1 for development, upgrade to Assisters Chat v2 when needed.
Ready to Build?
You're all set to start building with Assisters. Try it out in the playground or dive deeper into the API documentation.