Replace OpenAI's base_url with the platform address and use your platform-issued token as the api_key to start calling.
Get the API Address
API Address
The API Base URL starts with https://ailink.nativex.com/, for example https://ailink.nativex.com/v1 and https://ailink.nativex.com/v1/messages.
Configure Your Client
Fill in the address as base_url in your client or code, paired with your token to start calling.
Code Examples
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="sk-xxxxxxxxxxxxxxxx", # Your platform-issued token
base_url="https://ailink.nativex.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://ailink.nativex.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://ailink.nativex.com/v1beta/models/gemini-1.5-pro:generateContent?key=sk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"contents": [{"parts": [{"text": "Hello"}]}]}'
Supported Endpoints
| Endpoint | Path | Description |
|---|---|---|
| Chat Completions | POST /v1/chat/completions |
Conversational generation with streaming support |
| Text Completions | POST /v1/completions |
Legacy completions endpoint |
| Embeddings | POST /v1/embeddings |
Text vectorization |
| Image Generation | POST /v1/images/generations |
Text-to-image |
| Image Editing | POST /v1/images/edits |
Image editing |
| Speech-to-Text | POST /v1/audio/transcriptions |
Whisper and others |
| Text-to-Speech | POST /v1/audio/speech |
TTS |
| Rerank | POST /v1/rerank |
Document reranking |
| Responses API | POST /v1/responses |
OpenAI Responses format |
| Realtime | GET /v1/realtime (WebSocket) |
OpenAI Realtime API |
| Models | GET /v1/models |
List available models |