API Documentation
Complete guide to integrate DeepSoch AI into your applications
Quick Start
1Get Your API Key
Create an API key from your API Settings page
2Install SDK (Optional)
npm install deepsoch-ai or pip install deepsoch-ai
3Make Your First Request
Use one of the examples below to start building
Authentication
All API requests require authentication using your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYSecurity Warning: Never expose your API key in client-side code or public repositories.
Base URL
https://api.deepsoch.ai/v1SDK Examples
// Install: npm install deepsoch-ai
import DeepSoch from 'deepsoch-ai';
const client = new DeepSoch({
apiKey: process.env.DEEPSOCH_API_KEY
});
const response = await client.chat.create({
message: "Hello, how can you help me?",
model: "gpt-4"
});
console.log(response.choices[0].message.content);# Install: pip install deepsoch-ai
from deepsoch import DeepSoch
client = DeepSoch(api_key="YOUR_API_KEY")
response = client.chat.create(
message="Hello, how can you help me?",
model="gpt-4"
)
print(response.choices[0].message.content)curl -X POST https://api.deepsoch.ai/v1/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "Hello, how can you help me?",
"model": "gpt-4"
}'API Endpoints
/api/v1/chatSend a message to the AI and receive a response
Request
{
"headers": {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
"body": {
"message": "Hello, how can you help me?",
"model": "gpt-4",
"temperature": 0.7,
"max_tokens": 1000
}
}Response
{
"id": "msg_abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "gpt-4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm here to help you with any questions or tasks you have."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 15,
"total_tokens": 25
}
}/api/v1/modelsList all available AI models
Request
{
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}Response
{
"object": "list",
"data": [
{
"id": "gpt-4",
"object": "model",
"created": 1700000000,
"owned_by": "deepsoch"
},
{
"id": "gpt-3.5-turbo",
"object": "model",
"created": 1700000000,
"owned_by": "deepsoch"
}
]
}/api/v1/files/uploadUpload a file for processing
Request
{
"headers": {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "multipart/form-data"
},
"body": {
"file": "[binary file data]",
"purpose": "assistants"
}
}Response
{
"id": "file_abc123",
"object": "file",
"bytes": 12345,
"created_at": 1700000000,
"filename": "document.pdf",
"purpose": "assistants"
}/api/v1/chat/historyRetrieve chat history
Request
{
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
},
"params": {
"limit": 10,
"offset": 0
}
}Response
{
"object": "list",
"data": [
{
"id": "chat_123",
"created_at": 1700000000,
"messages": [
{
"role": "user",
"content": "Hello"
},
{
"role": "assistant",
"content": "Hi there!"
}
]
}
],
"has_more": true
}Rate Limits
| Plan | Requests per Minute | Requests per Day |
|---|---|---|
| Free | 10 | 1,000 |
| Pro | 60 | 10,000 |
| Business | 300 | 100,000 |
| Enterprise | Custom | Custom |
Error Codes
Bad Request
The request was invalid or missing required parameters
Unauthorized
Invalid or missing API key
Forbidden
API key doesn't have permission for this resource
Not Found
The requested resource doesn't exist
Too Many Requests
Rate limit exceeded
Internal Server Error
Something went wrong on our end
Need Help?
If you have questions or need assistance with the API, we're here to help.