curl https://api.xah.io/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: sk-YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model":"claude-opus-5",
"max_tokens":1024,
"messages":[
{"role":"user","content":"Write a fizzbuzz in Python."}
]
}'
Anthropic API ストリーミング
コピー
curl https://api.xah.io/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: sk-YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
--no-buffer \
-d '{
"model":"claude-opus-5",
"max_tokens":1024,
"stream":true,
"messages":[
{"role":"user","content":"Tell me a short story."}
]
}'
curl https://api.xah.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-YOUR_API_KEY" \
-d '{
"model":"gpt-5.4",
"messages":[
{"role":"user","content":"Hello from CKEY"}
]
}'
curl https://api.xah.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-YOUR_API_KEY" \
--no-buffer \
-d '{
"model":"gpt-5.4",
"stream":true,
"messages":[
{"role":"user","content":"Write a short poem."}
]
}'
curl "https://api.xah.io/v1beta/models/gemini-2.5-flash-lite:generateContent" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: sk-YOUR_API_KEY" \
-d '{
"contents":[
{"role":"user","parts":[{"text":"Write a fizzbuzz in Python."}]}
]
}'
curl https://api.xah.io/api/chat \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-YOUR_API_KEY" \
-d '{
"model":"glm-5.2",
"stream":false,
"messages":[
{"role":"user","content":"Hello from CKEY"}
]
}'
Ollama Generate(/api/generate)
コピー
curl https://api.xah.io/api/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-YOUR_API_KEY" \
-d '{
"model":"glm-5.2",
"prompt":"Hello from CKEY",
"stream":false
}'