Quick Start Guide
This guide is for API consumers — how to integrate OSP API into your application.
Step 1: Get Your API Key
- Log in to your OSP API admin panel
- Go to User → API Key
- Click Generate New Key and copy it
⚠️ The key is shown only once — store it securely
Step 2: Send Your First Request
OSP API is OpenAI-compatible. Use /v1/chat/completions:
bash
curl -X POST https://api.osp.io/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [{"role": "user", "content": "Hello"}]
}'Response:
json
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "Hello! How can I help you?"},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 9, "completion_tokens": 20, "total_tokens": 29}
}Step 3: Switch Models
Change the model field in your request:
| Model | Parameter | Provider |
|---|---|---|
| GPT-4 | gpt-4 | OpenAI |
| GPT-4o | gpt-4o | OpenAI |
| Claude 3.5 Sonnet | claude-3-5-sonnet | Anthropic |
| Gemini Pro | gemini-pro | |
| iFlytek Spark | spark-3.5 | iFlytek |
Common Models
| Model | Use Case | Provider |
|---|---|---|
gpt-4 / gpt-4o | Chat, code, writing | OpenAI |
claude-3-5-sonnet | Analysis, long context | Anthropic |
gemini-pro | Multimodal, reasoning | |
midjourney | Image generation | Midjourney |
suno-ai | Music generation | Suno |
gpt-4o-mini | Fast chat | OpenAI |
o1-mini | Fast reasoning | OpenAI |
Billing
- Token billing: Input + output tokens combined
- Channel markup: Different providers have different base prices
- Usage dashboard: Check "Data Dashboard" in admin panel
Need Help?
- See API Docs
- Contact your OSP API administrator