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.
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.
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."
}]
}'https://glideapi.dev/v1
Authorization: Bearer YOUR_GLIDE_KEY
# Anthropic Messages also accepts:
x-api-key: YOUR_GLIDE_KEYGET /v1/models before hard-coding one. It returns the models enabled for your account plus their current public prices and capability flags.Use the shape your client already speaks
Every route below uses the same API key and routes to the selected enabled model.
OpenAI Chat Completions
Best default for OpenAI-compatible SDKs and most chat integrations.
OpenAI Responses
Modern OpenAI request shape with input items, function tools, structured output, optional storage, and continuation.
Anthropic Messages
Anthropic-style messages, system prompts, content blocks, tool use, and event streaming.
Account and discovery
Retrieve live model metadata, balance, usage, costs, and per-model/per-key summaries.
Chat Completions
The broadest compatibility surface. Send standard chat messages, then use tools, vision, JSON output, and SSE when the chosen model supports them.
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)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" }]
});| Parameter | Use |
|---|---|
model | Required. An ID returned by /v1/models. |
messages | Required. Standard system, user, assistant, and tool messages. |
temperature, top_p | Sampling controls. Temperature is 0–2; top_p is 0–1. |
max_tokens or max_completion_tokens | Requested output ceiling. |
stream | Set true for Server-Sent Events. |
tools, tool_choice | Function tool declarations and selection. |
response_format | JSON object/schema output where the provider supports it. |
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.
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
}'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 fields | Notes |
|---|---|
input, instructions | String or supported input item arrays. Text and image inputs are accepted. |
tools, tool_choice | Function tools only. Your application executes the function and sends its result back in a later request. |
reasoning.effort, text.verbosity | Forwarded when the selected provider supports the related control. |
text.format | text, json_object, and json_schema map to structured output. |
stream | Returns typed Responses SSE events. |
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.Web search
Add web_search to a Responses request when the model needs current public information. GlideAPI searches the web before the model runs and returns the sources with the response.
curl https://glideapi.dev/v1/responses \
-H "Authorization: Bearer $GLIDE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-enabled-model",
"input": "What changed in AI this week?",
"tools": [{
"type": "web_search",
"max_num_results": 5
}]
}'{
"tools": [{
"type": "web_search",
"max_num_results": 5,
"filters": {
"allowed_domains": ["openai.com"]
}
}]
}| Field | Use |
|---|---|
type | Set to web_search (or web_search_preview for compatibility). |
max_num_results | Optional, 1–8; defaults to 5. |
filters.allowed_domains | Optional allow-list of up to 20 domains. |
web_search_call output item; cite the returned source URLs when using their information.Messages API
Use Claude/Anthropic-style requests with system prompts, message content blocks, image blocks, tool use, tool results, and compatible streaming events.
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."}]
}'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.
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.
{
"tools": [{
"type": "function",
"function": {
"name": "lookup_weather",
"description": "Get local weather",
"parameters": {
"type": "object",
"properties": {"city":{"type":"string"}},
"required": ["city"]
}
}
}],
"tool_choice": "auto"
}{
"messages": [{
"role": "user",
"content": [
{"type":"text", "text":"Describe this image."},
{"type":"image_url", "image_url": {
"url":"https://example.com/photo.png"
}}
]
}]
}Tool execution loop
- Send a request with your function definitions.
- When the model returns a tool call, execute it in your application.
- Send the result back as a tool message (or a Responses
function_call_outputitem). - Ask the model to produce the final answer.
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.
| API | Stream format | Final event |
|---|---|---|
| Chat Completions | OpenAI chunk objects | [DONE] |
| Responses | Typed Responses events | response.completed |
| Anthropic Messages | Anthropic message/content/delta events | message_stop |
X-Request-Id. Save this value with your application logs; it identifies the request without requiring you to share prompt content.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.
curl https://glideapi.dev/v1/conversations \
-H "Authorization: Bearer YOUR_GLIDE_KEY" \
-H "Content-Type: application/json" \
-d '{"metadata":{"project":"support-bot"}}'{
"model": "YOUR_MODEL_ID",
"previous_response_id": "resp_...",
"input": "Now make it shorter.",
"store": true
}| Route | Purpose |
|---|---|
POST /v1/conversations | Create 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.
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.
{
"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"
}
}]
}/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=100Usage filters accept period (24h, 7d, 30d, 90d), start_time, end_time, model, key_id, endpoint, and limit where applicable.
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": {
"message": "Insufficient balance. Please add credits to continue.",
"type": "payment_required"
}
}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 safelyRequest 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.