Skip to content

Quick Start Guide

This guide is for API consumers — how to integrate OSP API into your application.


Step 1: Get Your API Key

  1. Log in to your OSP API admin panel
  2. Go to UserAPI Key
  3. 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:

ModelParameterProvider
GPT-4gpt-4OpenAI
GPT-4ogpt-4oOpenAI
Claude 3.5 Sonnetclaude-3-5-sonnetAnthropic
Gemini Progemini-proGoogle
iFlytek Sparkspark-3.5iFlytek

Common Models

ModelUse CaseProvider
gpt-4 / gpt-4oChat, code, writingOpenAI
claude-3-5-sonnetAnalysis, long contextAnthropic
gemini-proMultimodal, reasoningGoogle
midjourneyImage generationMidjourney
suno-aiMusic generationSuno
gpt-4o-miniFast chatOpenAI
o1-miniFast reasoningOpenAI

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