Back to Documentation

API Reference

Complete API documentation for developers

Base URL

https://api.cozhub.ai

Authentication

All API requests require authentication using your API key in the Authorization header.

curl https://api.cozhub.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-ai/DeepSeek-V3.2", "messages": [{"role": "user", "content": "Hello!"}] }'

Endpoints

POST/v1/chat/completions

Chat Completions

Generate conversational responses using chat models

POST/v1/embeddings

Embeddings

Create vector embeddings for text

POST/v1/images/generations

Image Generation

Generate images from text prompts

POST/v1/audio/transcriptions

Audio

Speech-to-text and text-to-speech

Example: Chat Completions

Parameters

ParameterTypeRequiredDescription
modelstringYesModel ID (e.g., deepseek-ai/DeepSeek-V3.2)
messagesarrayYesArray of message objects with role and content
temperaturenumberNoSampling temperature (0-2), default 1
max_tokensintegerNoMaximum tokens to generate
streambooleanNoEnable streaming response, default false

Response

{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1705636520, "model": "deepseek-ai/DeepSeek-V3.2", "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 9, "completion_tokens": 12, "total_tokens": 21 } }

Rate Limits

API requests are rate limited based on your account tier. If you exceed the limit, you'll receive a 429 error.

TierRequests/minTokens/min
Free2040,000
Starter60150,000
Pro3001,000,000

Error Handling

The API uses standard HTTP response codes to indicate success or failure.

CodeDescription
200Success
400Bad request - Invalid parameters
401Unauthorized - Invalid API key
429Rate limit exceeded
500Internal server error

SDKs & Libraries

COZHUB API is compatible with the OpenAI SDK. Just change the base URL to use our API.

Python

pip install openai

Node.js

npm install openai