Use Models
After selecting a model in the Model Marketplace, you can view the model's endpoint information and usage examples, and copy the code directly to start calling.
Finding Model Endpoints
Go to the Model Marketplace, click on any model to enter its detail page, where you can see:
- Endpoint Management: Lists the available endpoint names, service providers, status, and billing information for that model
- Model Usage Examples: Provides curl and Python code examples that can be copied and used directly
The endpoint name format is {provider}@{model_name}@{interface_type}, for example:
aliyun_bailian_bj@qwen/qwen3.7-max@open_ai— Alibaba Cloud Bailian-Beijing, OpenAI-compatible interfaceaws_bedrock_us_east_1@anthropic/claude-opus-4.6@anthropic— AWS Bedrock US-East-1, Anthropic interface
Two Interface Formats
AI Gateway supports two calling interfaces, depending on the protocol type of the model:
| Interface Type | Path | Applicable Models |
|---|---|---|
| OpenAI-compatible | /gateway/v1/chat/completions | Qwen, DeepSeek, GLM, Kimi, Doubao, GPT, etc. |
| Anthropic-compatible | /gateway/v1/messages | Claude series |
curl Calls
OpenAI-Compatible Interface (Qwen, etc.)
Anthropic-Compatible Interface (Claude)
Python Calls
OpenAI-Compatible Interface (Recommended)
Use the openai library, pointing base_url to the AI Gateway endpoint:
Anthropic-Compatible Interface (Claude)
Use the requests library to call the Anthropic Messages interface directly:
You can also use the official anthropic SDK, replacing base_url with the AI Gateway address:
Notes
- Endpoint addresses differ by deployment region; use the actual example code in the Model Marketplace as the reference
- OpenAI-compatible interface uses
Authorization: Bearer <key>; Anthropic interface usesx-api-key: <key> - Model names must exactly match the model identifier in the endpoint; copy from the Model Marketplace detail page
- API Keys must be created in advance in API KEY Management with calling permissions enabled for the corresponding model
Related Documents
- Quick Start — Create API Key and configure routing
- Model Pricing — Billing standards for each model
- Call LLMs in SQL — Calling via AI_COMPLETE in Lakehouse SQL
