Skip to content

cURL Examples

Chat completion

curl https://api.studiolm.dev/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-3-12b-it-qat",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is the capital of France?"}
    ]
  }'

Streaming

curl https://api.studiolm.dev/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-3-12b-it-qat",
    "messages": [{"role": "user", "content": "Write a short poem."}],
    "stream": true
  }'

Image generation

curl https://api.studiolm.dev/v1/images/generations \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic cityscape at night, neon lights",
    "style": "vivid",
    "aspect_ratio": "landscape",
    "response_format": "url"
  }'
curl https://api.studiolm.dev/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-3-27b-it-qat",
    "messages": [{"role": "user", "content": "Latest AI news?"}],
    "web_search": "auto"
  }'

List models

curl https://api.studiolm.dev/v1/models \
  -H "Authorization: Bearer sk-..."

Text completions

curl https://api.studiolm.dev/v1/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-3-12b-it-qat",
    "prompt": "Write a poem about the ocean",
    "max_tokens": 150
  }'