Developer documentation

One gateway.
Three API shapes.

Use one GlideAPI key with OpenAI Chat Completions, OpenAI Responses, or Anthropic Messages. Keep your SDK, choose an enabled model, and send the request.

01 · First request

Start with a single curl command

Create a key in the customer console, then pass it as a bearer token. Keys are accepted on every API endpoint.

cURLPOST /v1/chat/completions
curl https://glideapi.dev/v1/chat/completions \
  -H "Authorization: Bearer YOUR_GLIDE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL_ID",
    "messages": [{
      "role": "user",
      "content": "Write a three-word greeting."
    }]
  }'
Base URLUse with OpenAI SDKs
https://glideapi.dev/v1

Authorization: Bearer YOUR_GLIDE_KEY

# Anthropic Messages also accepts:
x-api-key: YOUR_GLIDE_KEY
Model IDs are live data. Call GET /v1/models before hard-coding one. It returns the models enabled for your account plus their current public prices and capability flags.
02 · Endpoint map

Use the shape your client already speaks

Every route below uses the same API key and routes to the selected enabled model.

POST
/v1/chat/completions

OpenAI Chat Completions

Best default for OpenAI-compatible SDKs and most chat integrations.

POST
/v1/responses

OpenAI Responses

Modern OpenAI request shape with input items, function tools, structured output, optional storage, and continuation.

POST
/v1/messages or /anthropic/v1/messages

Anthropic Messages

Anthropic-style messages, system prompts, content blocks, tool use, and event streaming.

GET
/v1/models · /v1/balance · /v1/usage/summary

Account and discovery

Retrieve live model metadata, balance, usage, costs, and per-model/per-key summaries.

03 · OpenAI compatibility

Chat Completions

The broadest compatibility surface. Send standard chat messages, then use tools, vision, JSON output, and SSE when the chosen model supports them.

Pythonopenai
from openai import OpenAI

client = OpenAI(
  api_key="YOUR_GLIDE_KEY",
  base_url="https://glideapi.dev/v1"
)

reply = client.chat.completions.create(
  model="YOUR_MODEL_ID",
  messages=[{"role":"user", "content":"Say hello"}],
  temperature=0.2
)
print(reply.choices[0].message.content)
JavaScriptopenai
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.GLIDE_API_KEY,
  baseURL: "https://glideapi.dev/v1"
});

const reply = await client.chat.completions.create({
  model: "YOUR_MODEL_ID",
  messages: [{ role: "user", content: "Say hello" }]
});
ParameterUse
modelRequired. An ID returned by /v1/models.
messagesRequired. Standard system, user, assistant, and tool messages.
temperature, top_pSampling controls. Temperature is 0–2; top_p is 0–1.
max_tokens or max_completion_tokensRequested output ceiling.
streamSet true for Server-Sent Events.
tools, tool_choiceFunction tool declarations and selection.
response_formatJSON object/schema output where the provider supports it.
04 · OpenAI compatibility

Responses API

Use OpenAI’s Responses request shape when your app uses input, instructions, function-call output items, structured text, or optional persistent response state.

cURLPOST /v1/responses
curl https://glideapi.dev/v1/responses \
  -H "Authorization: Bearer YOUR_GLIDE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL_ID",
    "instructions": "Be concise.",
    "input": "Explain event loops.",
    "max_output_tokens": 220
  }'
Pythonclient.responses.create
response = client.responses.create(
  model="YOUR_MODEL_ID",
  input=[{
    "role": "user",
    "content": [{"type":"input_text", "text":"Summarize this."}]
  }],
  text={"format": {"type": "json_object"}}
)
Supported request fieldsNotes
input, instructionsString or supported input item arrays. Text and image inputs are accepted.
tools, tool_choiceFunction tools only. Your application executes the function and sends its result back in a later request.
reasoning.effort, text.verbosityForwarded when the selected provider supports the related control.
text.formattext, json_object, and json_schema map to structured output.
streamReturns typed Responses SSE events.
Included: use the web_search Responses tool for current public web results. Computer use, code interpreter, file search, image generation, background mode, and file-ID uploads are not hosted by GlideAPI. Function tools work when your own client executes the tool.
05 · Anthropic compatibility

Messages API

Use Claude/Anthropic-style requests with system prompts, message content blocks, image blocks, tool use, tool results, and compatible streaming events.

cURLPOST /v1/messages
curl https://glideapi.dev/v1/messages \
  -H "x-api-key: YOUR_GLIDE_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model":"YOUR_MODEL_ID",
    "max_tokens":256,
    "messages":[{"role":"user","content":"Explain event loops."}]
  }'
Pythonanthropic
import anthropic

client = anthropic.Anthropic(
  api_key="YOUR_GLIDE_KEY",
  base_url="https://glideapi.dev"
)

message = client.messages.create(
  model="YOUR_MODEL_ID",
  max_tokens=256,
  messages=[{"role":"user", "content":"Hello"}]
)

Use either x-api-key or Authorization: Bearer. Set stream: true to receive Anthropic-style message, content-block, delta, and message_stop events.

06 · Model capabilities

Function tools and vision inputs

Availability is model-dependent. Check the supports_tool_calling and supports_image_input fields in /v1/models before enabling either capability.

Function toolChat Completions
{
  "tools": [{
    "type": "function",
    "function": {
      "name": "lookup_weather",
      "description": "Get local weather",
      "parameters": {
        "type": "object",
        "properties": {"city":{"type":"string"}},
        "required": ["city"]
      }
    }
  }],
  "tool_choice": "auto"
}
VisionChat Completions
{
  "messages": [{
    "role": "user",
    "content": [
      {"type":"text", "text":"Describe this image."},
      {"type":"image_url", "image_url": {
        "url":"https://example.com/photo.png"
      }}
    ]
  }]
}

Tool execution loop

  1. Send a request with your function definitions.
  2. When the model returns a tool call, execute it in your application.
  3. Send the result back as a tool message (or a Responses function_call_output item).
  4. Ask the model to produce the final answer.
07 · Realtime delivery

Streaming and request tracing

Set stream: true. Responses are delivered over Server-Sent Events, so use an SSE-capable client and keep the connection open until the final event.

APIStream formatFinal event
Chat CompletionsOpenAI chunk objects[DONE]
ResponsesTyped Responses eventsresponse.completed
Anthropic MessagesAnthropic message/content/delta eventsmessage_stop
Debugging: every HTTP response includes X-Request-Id. Save this value with your application logs; it identifies the request without requiring you to share prompt content.
08 · Responses state

Stored responses and conversations

Responses are not stored by default. Set store: true to save a response, or pass a conversation ID to persist and continue a conversation.

Create a conversationPOST /v1/conversations
curl https://glideapi.dev/v1/conversations \
  -H "Authorization: Bearer YOUR_GLIDE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"metadata":{"project":"support-bot"}}'
Continue a responsePOST /v1/responses
{
  "model": "YOUR_MODEL_ID",
  "previous_response_id": "resp_...",
  "input": "Now make it shorter.",
  "store": true
}
RoutePurpose
POST /v1/conversationsCreate a conversation with optional metadata.
GET /v1/conversations/{id}Read its metadata and stored response IDs.
DELETE /v1/conversations/{id}Delete the conversation and its state.
GET /v1/responses/{id}Retrieve a response stored by the same API-key owner.
DELETE /v1/responses/{id}Delete a stored response.

Stored records are scoped to the API-key owner. Use either previous_response_id or conversation for a request, not both.

09 · Discovery and billing

Models, live rates, balance, and usage

Use discovery endpoints instead of copying model catalogs or prices into your app. The returned model list is the authoritative enabled list for your account.

ModelsGET /v1/models
{
  "object": "list",
  "data": [{
    "id": "YOUR_MODEL_ID",
    "supports_image_input": true,
    "supports_tool_calling": true,
    "pricing": {
      "input": 0.00,
      "output": 0.00,
      "currency": "usd",
      "label": "Per 1M tokens"
    }
  }]
}
Usage endpointsGET
/v1/me
/v1/balance
/v1/usage?period=30d
/v1/usage/logs?limit=100
/v1/usage/summary?period=7d
/v1/usage/costs?period=30d
/v1/usage/models?period=30d
/v1/usage/keys?period=30d
/v1/billing/history?limit=100

Usage filters accept period (24h, 7d, 30d, 90d), start_time, end_time, model, key_id, endpoint, and limit where applicable.

10 · Production behavior

Errors, limits, and privacy

Errors use JSON with a stable error object. Handle status codes in your client and record the request ID for troubleshooting.

Error shapeJSON
{
  "error": {
    "message": "Insufficient balance. Please add credits to continue.",
    "type": "payment_required"
  }
}
Common statusesHTTP
400  Invalid or unsupported request field
401  Invalid or missing API key
402  Insufficient balance
404  Unknown endpoint or stored resource
429  Rate limited; retry with backoff
5xx  Upstream or service failure; retry safely

Request privacy

Normal requests are not persisted by GlideAPI. Operational metadata such as timestamps, selected model, token counts, status, cost, balance changes, and error metadata may be kept for account operation. When you choose store: true or use a conversation, the associated response state is stored until you delete it. Read the Privacy Policy for the full policy.