Developer documentation

Connect the tools
you already use.

Setup paths for SDKs, coding agents, chat apps, and automation tools—plus the API reference behind them. One GlideAPI key, live model discovery, and compatible OpenAI or Anthropic request shapes.

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 · Setup playbooks

Bring your own agent, IDE, app, or workflow.

Pick the guide that matches your tool. OpenAI-compatible guides use https://glideapi.dev/v1. Anthropic-native clients use https://glideapi.dev so the client can append its own /v1/messages route.

01 / KEYCreate an API key

Open Console → API keys. Use a separate key per app or environment.

02 / MODELCopy a live model ID

Use GET /v1/models or Models. Do not guess names.

03 / TESTRun a small request

Start with text-only chat. Add vision, tools, or web search after the base request works.

Coding agents and IDE assistants

Claude CodeAnthropic-compatible endpoint for Claude-style coding workflows.
  1. Set the endpoint and token in the terminal that launches Claude Code.
  2. Set ANTHROPIC_MODEL to an enabled GlideAPI model ID.
  3. Restart Claude Code, then test with a short repository task.
export ANTHROPIC_BASE_URL="https://glideapi.dev"
export ANTHROPIC_AUTH_TOKEN="YOUR_GLIDE_KEY"
export ANTHROPIC_MODEL="YOUR_MODEL_ID"
claude
Codex CLIResponses-compatible custom provider for plain model calls.
  1. Create a custom provider in your Codex config.toml.
  2. Point it at GlideAPI’s /v1 base URL and select a Responses-compatible model.
  3. Use local tools normally; OpenAI-hosted tools are not supplied by GlideAPI.
model_provider = "glideapi"

[model_providers.glideapi]
base_url = "https://glideapi.dev/v1"
env_key = "GLIDE_API_KEY"
wire_api = "responses"
Cline, Roo Code, Kilo CodeVS Code coding agents using an OpenAI-compatible provider.
  1. Open the extension’s provider settings.
  2. Select OpenAI Compatible or OpenAI with a custom base URL.
  3. Enter the base URL, API key, and a live model ID.
Base URL: https://glideapi.dev/v1
API key: YOUR_GLIDE_KEY
Model: YOUR_MODEL_ID
Cursor and WindsurfUse only when your version exposes a custom OpenAI-compatible provider.
  1. Open model/provider settings and add a custom OpenAI endpoint.
  2. Paste the endpoint, key, and model ID.
  3. If your plan or version does not expose a custom endpoint field, it cannot be routed through GlideAPI.
Endpoint: https://glideapi.dev/v1
Authorization: Bearer YOUR_GLIDE_KEY
Model: YOUR_MODEL_ID
Continue, Aider, OpenCodeOpenAI-compatible developer tools and terminal agents.
  1. Choose the OpenAI provider in the tool’s config.
  2. Set the API base/base URL to GlideAPI.
  3. Set your key and exact model ID; keep the key out of source control.
OPENAI_API_BASE=https://glideapi.dev/v1
OPENAI_API_KEY=YOUR_GLIDE_KEY
# Then select YOUR_MODEL_ID in the tool config.
GitHub Copilot and fixed-provider agentsCompatibility check before setup.

Some products use only their own hosted model service and do not expose a custom OpenAI or Anthropic endpoint. Those products cannot be pointed at GlideAPI unless their specific version adds a custom-provider setting.

Chat UIs and internal apps

Open WebUI, LibreChat, LobeChatHosted chat frontends with an OpenAI-compatible connection.
  1. Add a new OpenAI connection in Admin/Provider settings.
  2. Set API base to GlideAPI and save the key as a server secret.
  3. Refresh models, then select an enabled model.
API base: https://glideapi.dev/v1
API key: YOUR_GLIDE_KEY
NextChat, Chatbox, AnythingLLMDesktop or self-hosted chat applications.
  1. Choose OpenAI-compatible or Custom OpenAI in settings.
  2. Paste the base URL and key.
  3. Use a live model ID and send a one-message test.
https://glideapi.dev/v1
YOUR_GLIDE_KEY
YOUR_MODEL_ID

Frameworks and automation

OpenAI SDK, LangChain, Vercel AI SDKUse an OpenAI-compatible base URL in code.

Set the SDK’s base URL to https://glideapi.dev/v1, provide a GlideAPI key, and pass an enabled model ID. Use Chat Completions for widest compatibility or Responses where your SDK supports it.

baseURL: "https://glideapi.dev/v1"
apiKey: process.env.GLIDE_API_KEY
model: "YOUR_MODEL_ID"
Dify, Flowise, n8nLow-code workflows and application builders.
  1. Create an OpenAI-compatible credential/connection.
  2. Set the API base and key as a platform secret.
  3. Select a model returned by /v1/models.
Base URL: https://glideapi.dev/v1
API key: YOUR_GLIDE_KEY
Model: YOUR_MODEL_ID
Compatibility rule: GlideAPI can serve any client that lets you choose a custom OpenAI-compatible or Anthropic-compatible endpoint. A tool that locks you to its own provider cannot be redirected. Features that depend on the tool’s own local filesystem, terminal, or MCP setup still run on the user’s side; provider-hosted services such as OpenAI’s Code Interpreter or hosted file search are not automatically added by changing the endpoint.
03 · 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.