API 文档
API Overview
Overview of the smai.ai API interface
Introduction
smai.ai provides an API interface that is fully compatible with OpenAI, allowing you to connect directly using any SDK or application that supports the OpenAI API.
Basic Information
| Item | Value |
|---|---|
| Base URL | https://api.smai.ai |
| API Version | v1 |
| Authentication Method | Bearer Token |
| Request Format | JSON |
| Response Format | JSON |
API Endpoints
Endpoint List
View all available API endpoints
Chat Completions
Conversation completion API, the most commonly used interface
Responses API
Endpoint dedicated to inference models
Error Handling
Error codes and handling methods
Authentication
All API requests require the API token to be included in the request header:
Authorization: Bearer sk-your-api-keySecurity Reminder
Do not expose your API token in client-side code. It is recommended to proxy API requests through a backend service.
Quick Example
curl https://api.smai.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"model": "gpt-4.1",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'Request Limits
- Rate Limit: Different request rate limits apply based on account level
- Concurrency Limit: There is a limit on the number of simultaneous requests
- Token Limit: The number of tokens per request is limited by the model
If you encounter limits, please try again later or contact customer service to upgrade your account.
