Query Available Models API
Two response formats of GET /v1/models, reading model IDs, and the difference between model visibility and actual callability.
Query models first, then write requests. GET https://1zheai.com/v1/models returns the models visible under the current key, group, and model limits, without needing to send an inference request.
OpenAI Format
Section titled “OpenAI Format”curl --fail-with-body --connect-timeout 10 --max-time 30 \ https://1zheai.com/v1/models \ -H "Authorization: Bearer $ONEZHE_API_KEY"Below is a simplified structural illustration; the actual list is based on the real response:
{ "object": "list", "data": [{"id": "gpt-5.6-sol", "object": "model"}]}When jq is installed, you can append | jq -r '.data[].id' after the request, displaying one model ID per line. Do not confuse the model_name of the public pricing endpoint with the id here.
Anthropic Format
Section titled “Anthropic Format”When using the following two request headers, the same path returns Anthropic-style data:
curl --fail-with-body https://1zheai.com/v1/models \ -H "x-api-key: $ONEZHE_API_KEY" \ -H "anthropic-version: 2023-06-01"Pay attention to data[].id, data[].display_name, and has_more. After switching authentication methods, do not continue parsing with the other response structure.
How to Use Query Results
Section titled “How to Use Query Results”- Copy the complete ID from
data[].id, preserving case, hyphens, and date suffixes. - Verify the interface type of that model in the console model catalog .
- Validate with a minimal text request, then gradually add images, tools, or other parameters.
The model list is not a real-time health check and does not include all parameter limits. Even if a model is visible, requests may still fail when no upstream is temporarily available; the official website’s HTTP availability monitoring also does not mean every model can successfully infer.
Empty List or Missing Models
Section titled “Empty List or Missing Models”Check the key’s model limits and group; models shown on the public pricing page are not necessarily open to every key. For 401, first check the key status; for 403, check access conditions; see error codes and troubleshooting for detailed steps.
For model series and selection recommendations, see supported models .
