Call Models

Scenario

Developers use API Keys to call models from business applications.

Prerequisites

  • You have an API Key.
  • The API Key is authorized for the target model.
  • The target model has an available channel.

Chat Completions Example

curl http://{ROUTER_HOST}:3080/v1/chat/completions \
  -H "Authorization: Bearer {API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "user",
        "content": "Generate a health-check summary"
      }
    ],
    "stream": false
  }'

Responses Example

curl http://{ROUTER_HOST}:3080/v1/responses \
  -H "Authorization: Bearer {API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "input": "Summarize today's API gateway status"
  }'

Verification

  • Confirm that the response returns a valid id, model, and output content.
  • Open Usage Log and check that the request token count, status, and selected channel are recorded.
  • If streaming is enabled, confirm that the client receives complete incremental output.