REST API

API Reference

Complete reference for all Ingate REST API endpoints. Organized by domain: proxy, prompts, evals, datasets, playground, sessions, usage, organizations, auth, and system.

Base URL

All API endpoints are available at https://api.ingateai.com. Include your API key in the X-Ingate-Key header with every request. Dashboard sessions may use Authorization: Bearer <token> instead.

API Versioning

All /api/* routes use the /api/v1/ prefix. The proxy wildcard route (POST /*) is the only exception. It matches any path not claimed by Ingate's own routes.

API Groups

Plus Sessions & Users, Organizations, Auth & Keys, and System See full endpoint tables below.

Proxy API

The proxy is the core of Ingate. Any request to a path not claimed by Ingate's own routes is forwarded to the target provider. Set X-Ingate-Provider to choose the destination.

MethodPathDescription
POST/*Proxy request to the configured provider. Supports streaming, fallback chains, caching, and format translation via headers.

Prompts API

Versioned prompt templates with variable interpolation. Each update creates a new immutable version. Render any version on-demand.

MethodPathDescription
POST/api/v1/promptsCreate a new prompt template
GET/api/v1/promptsList all prompts (paginated, filterable)
GET/api/v1/prompts/:ns/:slugGet prompt by namespace and slug
PUT/api/v1/prompts/:ns/:slugUpdate prompt (creates a new version)
DELETE/api/v1/prompts/:ns/:slugDelete prompt and all its versions
GET/api/v1/prompts/:ns/:slug/versionsList all versions of a prompt
GET/api/v1/prompts/:ns/:slug/versions/:versionGet a specific prompt version
POST/api/v1/prompts/:ns/:slug/renderRender template with provided variables

Evals API

Define evaluation criteria, trigger runs against datasets, and retrieve scored results. Runs are async. Poll or use webhooks for completion.

MethodPathDescription
POST/api/v1/evalsCreate eval definition
GET/api/v1/evalsList eval definitions
GET/api/v1/evals/:idGet eval definition by ID
PUT/api/v1/evals/:idUpdate eval definition
DELETE/api/v1/evals/:idDelete eval definition
POST/api/v1/evals/:id/runTrigger a manual eval run
GET/api/v1/evals/runsList all eval runs (across definitions)
GET/api/v1/evals/runs/:runIdGet run status and metadata
GET/api/v1/evals/:id/resultsList scored results for an eval
GET/api/v1/evals/runs/:runId/resultsGet results for a specific run

Datasets API

Versioned collections of test cases used by evals and the playground. Import from JSON/CSV, sample subsets, and link datasets to eval runs.

MethodPathDescription
POST/api/v1/datasetsCreate a new dataset
GET/api/v1/datasetsList datasets (paginated)
GET/api/v1/datasets/:idGet dataset by ID
PUT/api/v1/datasets/:idUpdate dataset metadata
DELETE/api/v1/datasets/:idDelete dataset and all versions
GET/api/v1/datasets/:id/versionsList dataset versions
POST/api/v1/datasets/:id/versionsCreate a new version (snapshot)
GET/api/v1/datasets/:id/casesList test cases in current version
POST/api/v1/datasets/:id/casesAdd test cases to dataset
PUT/api/v1/datasets/:id/cases/:caseIdUpdate a specific test case
DELETE/api/v1/datasets/:id/cases/:caseIdRemove a test case
POST/api/v1/datasets/:id/importBulk import cases from JSON or CSV
POST/api/v1/datasets/:id/sampleRandom-sample a subset of cases
POST/api/v1/datasets/:id/evalRun an eval against this dataset

Playground API

Power the interactive playground. Run completions, compare multiple models side-by-side, browse history, and save iterations as prompt versions.

MethodPathDescription
POST/api/v1/playground/runExecute a single completion request
POST/api/v1/playground/compareRun the same prompt against multiple models in parallel
GET/api/v1/playground/historyList recent playground runs for the current user
GET/api/v1/playground/history/:idGet details of a specific playground run
POST/api/v1/playground/save-versionSave current playground state as a new prompt version
GET/api/v1/playground/providersList available providers and models for the playground

Sessions & Users API

Inspect proxy session logs, view request timelines, and get per-user usage summaries. Useful for debugging and audit trails.

MethodPathDescription
GET/api/v1/sessionsList proxy sessions (paginated, filterable by user/provider/time)
GET/api/v1/sessions/:idGet session detail including request/response metadata
GET/api/v1/sessions/:id/timelineGet ordered timeline of events within a session
GET/api/v1/users/:userId/summaryPer-user usage summary (requests, tokens, cost, top models)

Usage & Cost API

Analytics endpoints for token consumption, cost attribution, and time-series data. Filter by provider, model, key, or time range.

MethodPathDescription
GET/api/v1/usage/summaryAggregate usage summary (total requests, tokens, cost)
GET/api/v1/usage/timeseriesTime-bucketed usage data (hourly, daily, weekly)
GET/api/v1/usage/breakdownCost breakdown by provider, model, key, or team
GET/api/v1/usage/pricesCurrent per-model pricing table used for cost calculation

Organizations API

Manage organizations, teams within orgs, and application registrations. Entitlements flow: key โ†’ org โ†’ plan โ†’ features.

MethodPathDescription
POST/api/v1/orgsCreate a new organization
GET/api/v1/orgsList organizations for the authenticated user
GET/api/v1/orgs/:orgIdGet organization details and current plan
PUT/api/v1/orgs/:orgIdUpdate organization settings
DELETE/api/v1/orgs/:orgIdDelete organization (requires owner role)
GET/api/v1/orgs/:orgId/teamsList teams in the organization
POST/api/v1/orgs/:orgId/teamsCreate a new team
PUT/api/v1/orgs/:orgId/teams/:teamIdUpdate team membership or settings
DELETE/api/v1/orgs/:orgId/teams/:teamIdDelete a team
GET/api/v1/orgs/:orgId/appsList registered applications
POST/api/v1/orgs/:orgId/appsRegister a new application
PUT/api/v1/orgs/:orgId/apps/:appIdUpdate application configuration
DELETE/api/v1/orgs/:orgId/apps/:appIdUnregister an application

Auth & Keys API

User authentication (signup, login, sessions) and API key lifecycle management including creation, listing, rotation, and revocation.

MethodPathDescription
POST/api/v1/auth/signupCreate a new user account
POST/api/v1/auth/loginAuthenticate and receive a session token
POST/api/v1/auth/logoutInvalidate the current session
GET/api/v1/auth/meGet current authenticated user profile
POST/api/v1/keysCreate a new API key (scoped to org)
GET/api/v1/keysList API keys for the current org
GET/api/v1/keys/:keyIdGet key metadata (never returns the secret)
PUT/api/v1/keys/:keyIdUpdate key name or permissions
DELETE/api/v1/keys/:keyIdRevoke an API key immediately
POST/api/v1/keys/:keyId/rotateRotate key. Issues a new secret, old key remains valid for a grace period

System API

Operational endpoints for health checks, metrics export, and recent gateway log retrieval. No authentication required for /healthz.

MethodPathDescription
GET/healthzHealth check. Returns 200 OK when the gateway is ready
GET/api/v1/metricsJSON metrics snapshot (request counts, latency percentiles, error rates)
GET/api/v1/logsRecent gateway logs (filterable by level, provider, time range)

Authentication

Every request (except /healthz and /api/v1/auth/*) must include one of the following:

HeaderValueUse Case
X-Ingate-Keying_...API key authentication for programmatic access from your backend or SDK
AuthorizationBearer <token>Session token, used by the dashboard and playground web UI

Key Security

API keys carry the permissions of their parent organization. Treat them like passwords. Never commit keys to source control or expose them in client-side code. Use POST /api/v1/keys/:keyId/rotate if a key is compromised.

Error Codes

All endpoints return consistent JSON error bodies with a machine-readable code field and a human-readable message.

HTTP StatusCodeDescription
400bad_requestInvalid request body or query parameters
401unauthorizedMissing or invalid authentication
403forbiddenValid auth but insufficient permissions or plan
404not_foundResource does not exist
409conflictResource already exists or version conflict
422validation_errorSemantic validation failure (e.g. invalid template syntax)
429rate_limitedToo many requests. Check Retry-After header
502provider_errorUpstream provider returned an error
504provider_timeoutUpstream provider did not respond in time

Rate Limits

Rate limits are applied per API key and vary by plan. Current limits are returned in response headers:

HeaderDescription
X-RateLimit-LimitMax requests per window
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the window resets
Retry-AfterSeconds to wait (only present on 429 responses)