The space implements an OpenAI-compatible API at /v1/chat/completions.
curl -X POST https://leon4gr45-fable5-inference.hf.space/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-3-4b-it-qat-q4_0",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 50
}'
curl -X POST https://leon4gr45-fable5-inference.hf.space/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-3-4b-it-qat-q4_0",
"messages": [{"role": "user", "content": "Tell me a story."}],
"stream": true
}'
If you have an API key, you can provide it in the Authorization header to get priority scheduling in the inference queue.
curl -X POST https://leon4gr45-fable5-inference.hf.space/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gemma-3-4b-it-qat-q4_0",
"messages": [{"role": "user", "content": "Hello with priority!"}]
}'