MAX APIMAX API
User GuideInstallationAPI ReferenceAI ApplicationsHelp & 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

Select a Model and Group

Choose a model and an available group above the prompt. When you choose an auto or auto:* group, the Playground loads the model collection available to the current user. Actual availability still depends on the channels, groups, and permissions configured by an administrator.

Model Parameters

Select the parameter button in the prompt toolbar to open parameter settings. It opens in a popover on desktop and a bottom sheet on mobile. Each parameter must be enabled individually. Only enabled parameters are sent with the chat-completion request. Settings are stored in the current browser so they can be reused for later tests.

ParameterRangePurpose
Temperature0 - 2, step 0.1Controls randomness and creativity. Lower values are usually more stable; higher values are usually more varied.
Top P0 - 1, step 0.05Limits candidate tokens to a cumulative probability mass.
Frequency Penalty-2 - 2, step 0.1Reduces repeated wording.
Presence Penalty-2 - 2, step 0.1Encourages the model to introduce new topics.
Max Tokens1 - 200000, integerCaps response length.
Seed0 - 2147483647, integer, optionalMakes equivalent requests more repeatable on supported models. Leave it blank to omit seed.

Values are normalized to the control range and step. Parameter support varies by model and upstream service. If an upstream service rejects an enabled field, disable that parameter or select a compatible model.

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
Alpha SearchPOST /v1/alpha/searchStandalone Web Search relay for Codex and Advanced Custom pass-through routes; see OpenAI Alpha Search
RealtimeGET /v1/realtime (WebSocket)OpenAI Realtime API
ModelsGET /v1/modelsList available models

How is this guide?