Bottom line: When calling the Claude series model in AIFast, first use
https://www.aifast.hk/v1/modelsQuery the real model ID available in the current account, and then use OpenAI Compatible's/v1/chat/completionsComplete minimal requests. Do not guess the model ID based on the promotional name, and do not default to native Anthropic Messages parameters that can be reused directly.
When is it appropriate to access this way?
If the existing project already uses the OpenAI SDK, or the tool supports custom OpenAI Compatible addresses, this method usually only requires replacing three configurations:
| Configuration items | Fill in the content |
|---|---|
| Base URL | https://www.aifast.hk/v1 |
| API Key | an independent API key created in the AIFast console |
| Model | from /v1/models or the real Claude model ID copied by the console |
What is verified here is the OpenAI Compatible call link. If the project relies on Anthropic Messages, Prompt Caching, or other vendor-specific fields, you should check firstCompatibility Matrix, and then use the temporary Key for function acceptance.
Claude Fable 5.2 model ID and account access
HK catalog check on 2026-11-10: claude-fable-5-2 is listed with available set to true, anthropic and openai endpoint types, and Claude-Code-1, Claude-Code-2 and Claude-Code-3 groups. This is a catalog observation, not an authenticated generation, streaming or tool-call test.
Verify the HK key group and model permissions before setting MODEL_ID below. The official release does not guarantee HK performance, Fast mode or long-context support. Check prices against the current marketplace and account group.
export MODEL_ID="claude-fable-5-2"
Set Claude Code ANTHROPIC_BASE_URL to https://www.aifast.hk, with the final request path /v1/messages; the OpenAI SDK Base URL is https://www.aifast.hk/v1. Do not interchange these settings. If a listed model returns model not found, check the exact ID and key group before changing domains.
For credentials, configuration precedence and /status verification, seeClaude Code configuration tutorial; for path checks without a key, useBase URL checker.
Step 1: Query the current Claude model
export AIFAST_API_KEY="your_API_Key"
curl --fail-with-body --silent --show-error \
https://www.aifast.hk/v1/models \
-H "Authorization: Bearer $AIFAST_API_KEY"
on return data Find the required Claude model in the array and copy it completely id. The model above is a dated catalog example, not a substitute for checking the current account's access and pricing.
Step 2: Send a minimal request
First set the ID copied from the model list:
export MODEL_ID="real copied from model list_ID"
Send a non-streaming request:
curl --fail-with-body --silent --show-error \
https://www.aifast.hk/v1/chat/completions \
-H "Authorization: Bearer $AIFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "'"$MODEL_ID"'",
"messages": [
{"role": "user", "content": "Reply with only CLAUDE_API_READY"}
],
"temperature": 0
}'
A successful response should contain at least a parsable choices. Also record the response model、usage and request ID; these fields facilitate subsequent verification of routing and billing, but a single model Fields cannot independently prove the identity of the underlying model.
Step 3: Use the Python SDK
python -m pip install --upgrade openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AIFAST_API_KEY"],
base_url="https://www.aifast.hk/v1",
)
response = client.chat.completions.create(
model=os.environ["MODEL_ID"],
messages=[
{"role": "user", "content": "Organize this requirement into three acceptance conditions。"}
],
)
print(response.choices[0].message.content)
In production, store the API key, model ID, and Base URL in server-side environment variables or a secrets manager, never in frontend code or a public repository.
Must be verified before going online
- Use real business prompt words to verify constraint compliance, not just test "hello".
- Use
stream=trueCheck for SSE delta and end events. - If the business relies on tool calls, use random tool names and random parameters to verify the structured results.
- Record multi-period success rate, P50, P95, error distribution and complete task cost.
- Set limited retry, backoff and fallback models for 429s, timeouts and 5xx.
You can run it firstFree model checkingGenerate itemized reports. This test is a black box compatibility and risk screening and is not an official Anthropic certification.
How to troubleshoot common failures
401 or 403
Check whether the Key has extra quotes, spaces, whether it has been revoked, and whether the request header is used Authorization: Bearer. Do not mix OpenAI official Key, Anthropic official Key and third-party platform Key.
404 or return HTML
Check the final request address. A common mistake is to fill in https://www.aifast.hk/v1 After that, the client appends again /v1, form /v1/v1/chat/completions.
model not found
Request /v1/models, confirm that you are using id Instead of the webpage title, manufacturer name or model series name, and confirm that the model is open to the current account.
Claude Code cannot be reused directly
Claude Code may rely on the Anthropic protocol and specialized environment variables and is not equivalent to the normal OpenAI Compatible client. Please useClaude Code configuration tutorialandClaude Code Gateway Acceptance ChecklistCheck item by item.
Next step
After the basic call is successful, continue verificationStreaming SSE、API Cost ControlandProduction on-line checklist. Model ID, price and open status are always based on the console and live API.