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.
Key Parameters
Section titled “Key Parameters”| 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 |
Obtaining an API Key
Section titled “Obtaining an API Key”- Sign up or log in at the AlphaTech Console.
- Click API Keys in the left sidebar and select Create Key.
- Copy the generated key and store it securely.
- Export the key as an environment variable in your terminal:
export ALPHATECH_API_KEY="sk-xxxx"Sending Your First Request
Section titled “Sending Your First Request”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 }'pip install openaiimport osfrom openai import OpenAI
client = OpenAI( api_key=os.environ.get("ALPHATECH_API_KEY"), base_url="https://alphatech.net.cn/v1",)
response = client.chat.completions.create( 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,)
print(response.choices[0].message.content)npm install openaiimport OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.ALPHATECH_API_KEY, baseURL: "https://alphatech.net.cn/v1",});
async function main() { const completion = await client.chat.completions.create({ 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, });
console.log(completion.choices[0].message.content);}
main();Streaming Responses
Section titled “Streaming Responses”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.
Next Steps
Section titled “Next Steps”- Models and pricing: Browse all 40 available model IDs and rates
- Chat Completions API: Full request parameters and response schemas
- Errors: Troubleshooting 401, 404, and 429 status codes
- Tool Integrations: Claude Code, Cursor, Cline, Cherry Studio, Codex