Skip to content

API Overview ​

OSP API exposes a unified, OpenAI-compatible interface for easy integration.


Authentication ​

Include your API key in every request header:

Authorization: Bearer sk-xxxxxxxxxxxxxxxx

Base URL ​

https://api.osp.io

Supported Endpoints ​

Chat Completions /v1/chat/completions ​

json
POST /v1/chat/completions
{
  "model": "gpt-4",
  "messages": [{"role": "user", "content": "Hello"}]
}

Text Completions /v1/completions ​

json
POST /v1/completions
{
  "model": "gpt-3.5-turbo-instruct",
  "prompt": "The capital of France is"
}

Image Generation /v1/images/generations ​

json
POST /v1/images/generations
{
  "model": "dall-e-3",
  "prompt": "A cute baby sea otter",
  "size": "1024x1024"
}

Embeddings /v1/embeddings ​

json
POST /v1/embeddings
{
  "model": "text-embedding-3-small",
  "input": "The food was delicious"
}

List Models /v1/models ​

json
GET /v1/models

Error Handling ​

StatusMeaning
200Success
400Bad request
401Invalid API key
403No permission
429Rate limit — wait 3-5s and retry
500Internal error