Back to API Settings

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_KEY

Security Warning: Never expose your API key in client-side code or public repositories.

Base URL

https://api.deepsoch.ai/v1

SDK Examples

JavaScript/Node.js
// 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);
Python
# 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
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

POST/api/v1/chat

Send 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
  }
}
GET/api/v1/models

List 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"
    }
  ]
}
POST/api/v1/files/upload

Upload 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"
}
GET/api/v1/chat/history

Retrieve 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

PlanRequests per MinuteRequests per Day
Free101,000
Pro6010,000
Business300100,000
EnterpriseCustomCustom

Error Codes

400

Bad Request

The request was invalid or missing required parameters

401

Unauthorized

Invalid or missing API key

403

Forbidden

API key doesn't have permission for this resource

404

Not Found

The requested resource doesn't exist

429

Too Many Requests

Rate limit exceeded

500

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.