Getting Started
Welcome to LLMSaver! This guide will help you get started with our API in just a few minutes.
Quick Start
- Create an account and get your API key
- Make your first API call
- Explore our models and features
Your First API Call
curl -X POST https://api.llmsaver.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [
{
"role": "user",
"content": "Hello, world!"
}
]
}'
Authentication
LLMSaver uses API keys for authentication. Include your API key in the Authorization header of your requests.
API Key Format
Authorization: Bearer llms_1234567890abcdef
Keep your API key secure! Never expose it in client-side code or public repositories.
API Reference
Complete reference for all LLMSaver API endpoints.
Chat Completions
Generate text completions using various AI models.
Endpoint
POST
/v1/chat/completions
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
model | string | Yes | The model to use for completion |
messages | array | Yes | Array of message objects |
temperature | number | No | Sampling temperature (0-1) |
max_tokens | integer | No | Maximum tokens to generate |
Available Models
LLMSaver provides access to state-of-the-art AI models from leading providers.
GPT-4
OpenAI's most capable model with superior reasoning abilities.
- Context: 128k tokens
- Best for: Complex reasoning, analysis
- Cost: $0.03/1k tokens
Claude 3
Anthropic's latest model with excellent safety and reasoning.
- Context: 200k tokens
- Best for: Long documents, safety-critical tasks
- Cost: $0.025/1k tokens
Code Examples
Ready-to-use code examples in popular programming languages.
Python
import requests
url = "https://api.llmsaver.com/v1/chat/completions"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"model": "gpt-4",
"messages": [
{"role": "user", "content": "Hello!"}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
JavaScript
const response = await fetch('https://api.llmsaver.com/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-4',
messages: [
{ role: 'user', content: 'Hello!' }
]
})
});
const data = await response.json();
console.log(data);