Documentation renewed! For old docs, visit doc.newapi.pro
New APINew API
User GuideInstallationAPI ReferenceAI ApplicationsSkillsHelp & SupportBusiness Cooperation
User Guide

Using the API

Replace OpenAI's base_url with the platform address and use your token as the api_key

Replace OpenAI's base_url with the platform address and use your platform-issued token as the api_key to start calling.

Playground

Playground is a built-in online testing tool. You can chat with models directly without writing any code — ideal for quickly verifying that your token works.

  1. Click "Playground" in the left sidebar, or visit /console/playground directly

Playground page

  1. Select the model you want to test from the left panel
  2. Type a message in the input box at the bottom and click Send
  3. The model's response appears in the conversation area on the right

Playground conversation example

Get the API Address

  1. Visit the platform homepage
  2. Find the API Base URL display area in the middle of the page
  3. Click the copy button to copy the address to your clipboard

Homepage API address copy area

Use the copied address as base_url in your client or code, paired with your token.

Code Examples

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    api_key="sk-xxxxxxxxxxxxxxxx",  # Your platform token
    base_url="https://your-platform.com/v1"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Claude Native Format

curl https://your-platform.com/v1/messages \
  -H "x-api-key: sk-xxxxxxxx" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model": "claude-3-5-sonnet-20241022", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'

Gemini Native Format

curl "https://your-platform.com/v1beta/models/gemini-1.5-pro:generateContent?key=sk-xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"contents": [{"parts": [{"text": "Hello"}]}]}'

Supported Endpoints

EndpointPathDescription
Chat CompletionsPOST /v1/chat/completionsConversational generation with streaming support
Text CompletionsPOST /v1/completionsLegacy completions endpoint
EmbeddingsPOST /v1/embeddingsText vectorization
Image GenerationPOST /v1/images/generationsText-to-image
Image EditingPOST /v1/images/editsImage editing
Speech-to-TextPOST /v1/audio/transcriptionsWhisper and others
Text-to-SpeechPOST /v1/audio/speechTTS
RerankPOST /v1/rerankDocument reranking
Responses APIPOST /v1/responsesOpenAI Responses format
RealtimeGET /v1/realtime (WebSocket)OpenAI Realtime API
ModelsGET /v1/modelsList available models

How is this guide?

Last updated on