Skip to main content
Glama

API

Glama Gateway is an OpenAI-compatible API for your LLMs.

POST /api/gateway/openai/v1/chat/completions

Make a chat completion request.

As the API is OpenAI-compatible, you can reference the OpenAI API documentation and use it with the official OpenAI SDKs.

fetch("https://glama.ai/api/gateway/openai/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <GLAMA_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "openai/gpt-4o",
    "messages": [
      {"role": "user", "content": "Hello, World!"}
    ]
  })
});

GET /api/gateway/openai/v1/models

List the available models.

GET /gateway/v1/completion-requests/:id

Get the status of a single completion request.

Note: id can be found the the API response headers (x-request-id) of a completion request.