Skip to content

First API Call

AlphaTech API provides endpoints fully compatible with OpenAI open standards. By simply configuring the base URL and API key, you can call models directly via the official OpenAI SDK or any compatible tool.

Parameter Description Recommended Value
Base URL Base URL for OpenAI-compatible endpoints https://alphatech.net.cn/v1
API Key Authentication key (passed as a Bearer Token) sk-xxxx
Recommended Models Verified active model IDs deepseek-v4.1-flash or gpt-6-luna
  1. Sign up or log in at the AlphaTech Console.
  2. Click API Keys in the left sidebar and select Create Key.
  3. Copy the generated key and store it securely.
  4. Export the key as an environment variable in your terminal:
终端窗口
export ALPHATECH_API_KEY="sk-xxxx"

The examples below illustrate how to send a chat completion request. For all available models, see Models and pricing.

终端窗口
curl https://alphatech.net.cn/v1/chat/completions \
-H "Authorization: Bearer $ALPHATECH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [
{"role": "system", "content": "You are a concise, helpful assistant."},
{"role": "user", "content": "Explain what an API gateway does in one sentence."}
],
"stream": false
}'

Set "stream": true in your request body to receive responses as Server-Sent Events (SSE):

stream = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Write a quicksort implementation."}],
stream=True,
)
for chunk in stream:
content = chunk.choices[0].delta.content or ""
print(content, end="", flush=True)
print()

For more details, see Streaming.

需要进一步了解企业方案,或确认服务状态?