curl
curl
Raw HTTP is the lowest-common-denominator client — useful for scripts, CI, and debugging. All endpoints take a Bearer key and return standard OpenAI-compatible JSON.
Set your key once:
export FREMAI_API_KEY="sk-fremai-…"Chat completion
curl https://api.fremai.eu/v1/chat/completions \
-H "Authorization: Bearer $FREMAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "What is EU data sovereignty in one sentence?"}
],
"temperature": 0.3
}'Streaming
Add "stream": true. The response is a Server-Sent Events stream of chat.completion.chunk objects, terminated by data: [DONE]:
curl -N https://api.fremai.eu/v1/chat/completions \
-H "Authorization: Bearer $FREMAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"messages": [{"role": "user", "content": "Stream a short greeting."}],
"stream": true
}'Embeddings
curl https://api.fremai.eu/v1/embeddings \
-H "Authorization: Bearer $FREMAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<embedding-model-id>",
"input": ["EU-sovereign inference", "OpenAI-compatible API"]
}'List models
curl https://api.fremai.eu/v1/models \
-H "Authorization: Bearer $FREMAI_API_KEY"Returns the catalog available to your key. Each id is a value you can pass as model.
Tips
- Use
-N(--no-buffer) when streaming so curl prints chunks as they arrive. - On a
429, respect theRetry-Afterresponse header before retrying. See error codes. - The
/v1prefix is the advertised form; the API also answers the bare-root path (e.g./chat/completions) for clients configured without it.