--- name: omni-providers description: "Manage provider connections, API keys, OAuth flows, and connection tests via the REST API. List, add, update, remove, and test AI provider integrations across OmniRoute's 327-provider catalog." --- ## Overview Manage provider connections, API keys, OAuth flows, and connection tests via the REST API. List, add, update, remove, and test AI provider integrations across OmniRoute's 327-provider catalog. ## Authentication All requests require a valid Bearer token or session cookie. Obtain a token via `POST /api/auth/login` or configure `REQUIRE_API_KEY=false` for local development. ## Endpoints ### GET /api/providers List provider connections ```bash curl https://localhost:20128/api/providers \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers Create provider connection ```bash curl -X POST https://localhost:20128/api/providers \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/{id} Get provider connection ```bash curl https://localhost:20128/api/providers/{id} \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### PATCH /api/providers/{id} Update provider connection ```bash curl -X PATCH https://localhost:20128/api/providers/{id} \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### DELETE /api/providers/{id} Delete provider connection ```bash curl -X DELETE https://localhost:20128/api/providers/{id} \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/{id}/test Test provider connection ```bash curl -X POST https://localhost:20128/api/providers/{id}/test \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/{id}/models List models for a provider ```bash curl https://localhost:20128/api/providers/{id}/models \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### GET /api/providers/cursor/agent-availability Check cursor-agent availability Credential-free, informational check for whether cursor-agent is installed and authenticated on this host — backs the dashboard's dismissible install-nudge banner. Returns only cursorAgentAvailable (boolean); never tokens or machineId. ```bash curl https://localhost:20128/api/providers/cursor/agent-availability \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/test-batch Test multiple providers at once ```bash curl -X POST https://localhost:20128/api/providers/test-batch \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/validate Validate provider credentials ```bash curl -X POST https://localhost:20128/api/providers/validate \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/client Get client-side provider info ```bash curl https://localhost:20128/api/providers/client \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/agy-auth/import Import an Antigravity CLI (agy) token file as an `agy` connection ```bash curl -X POST https://localhost:20128/api/providers/agy-auth/import \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/agy-auth/import-bulk Bulk-import multiple Antigravity CLI (agy) token files (up to 50) ```bash curl -X POST https://localhost:20128/api/providers/agy-auth/import-bulk \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/agy-auth/zip-extract Extract `.json` token files from an uploaded ZIP for agy bulk import ```bash curl -X POST https://localhost:20128/api/providers/agy-auth/zip-extract \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/agy-auth/apply-local Auto-detect and import the local Antigravity CLI (agy) login from disk ```bash curl -X POST https://localhost:20128/api/providers/agy-auth/apply-local \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/provider-nodes List provider nodes ```bash curl https://localhost:20128/api/provider-nodes \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/provider-nodes Create provider node ```bash curl -X POST https://localhost:20128/api/provider-nodes \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### PATCH /api/provider-nodes/{id} Update provider node ```bash curl -X PATCH https://localhost:20128/api/provider-nodes/{id} \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### DELETE /api/provider-nodes/{id} Delete provider node ```bash curl -X DELETE https://localhost:20128/api/provider-nodes/{id} \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/provider-nodes/validate Validate a provider node ```bash curl -X POST https://localhost:20128/api/provider-nodes/validate \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/provider-models List provider models ```bash curl https://localhost:20128/api/provider-models \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### GET /api/providers/{id}/cc-alias GET providers › › cc alias ```bash curl https://localhost:20128/api/providers/{id}/cc-alias \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### PUT /api/providers/{id}/cc-alias PUT providers › › cc alias ```bash curl -X PUT https://localhost:20128/api/providers/{id}/cc-alias \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/{id}/chatgpt-web-codex-doctor GET providers › › chatgpt web codex doctor ```bash curl https://localhost:20128/api/providers/{id}/chatgpt-web-codex-doctor \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/{id}/claude-auth/apply-local POST providers › › claude auth › apply local ```bash curl -X POST https://localhost:20128/api/providers/{id}/claude-auth/apply-local \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/{id}/claude-auth/export POST providers › › claude auth › export ```bash curl -X POST https://localhost:20128/api/providers/{id}/claude-auth/export \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/{id}/codex-auth/apply-local POST providers › › codex auth › apply local ```bash curl -X POST https://localhost:20128/api/providers/{id}/codex-auth/apply-local \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/{id}/codex-auth/export POST providers › › codex auth › export ```bash curl -X POST https://localhost:20128/api/providers/{id}/codex-auth/export \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/{id}/interception-rules GET providers › › interception rules ```bash curl https://localhost:20128/api/providers/{id}/interception-rules \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### PUT /api/providers/{id}/interception-rules PUT providers › › interception rules ```bash curl -X PUT https://localhost:20128/api/providers/{id}/interception-rules \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### DELETE /api/providers/{id}/interception-rules DELETE providers › › interception rules ```bash curl -X DELETE https://localhost:20128/api/providers/{id}/interception-rules \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/{id}/login POST providers › › login ```bash curl -X POST https://localhost:20128/api/providers/{id}/login \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/{id}/param-filters GET providers › › param filters ```bash curl https://localhost:20128/api/providers/{id}/param-filters \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### PUT /api/providers/{id}/param-filters PUT providers › › param filters ```bash curl -X PUT https://localhost:20128/api/providers/{id}/param-filters \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### DELETE /api/providers/{id}/param-filters DELETE providers › › param filters ```bash curl -X DELETE https://localhost:20128/api/providers/{id}/param-filters \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/{id}/refresh POST providers › › refresh ```bash curl -X POST https://localhost:20128/api/providers/{id}/refresh \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/{id}/refresh-cursor POST providers › › refresh cursor ```bash curl -X POST https://localhost:20128/api/providers/{id}/refresh-cursor \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/{id}/refresh-token POST providers › › refresh token ```bash curl -X POST https://localhost:20128/api/providers/{id}/refresh-token \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/{id}/sync-models POST providers › › sync models ```bash curl -X POST https://localhost:20128/api/providers/{id}/sync-models \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/bulk POST providers › bulk ```bash curl -X POST https://localhost:20128/api/providers/bulk \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/bulk-web-session POST providers › bulk web session ```bash curl -X POST https://localhost:20128/api/providers/bulk-web-session \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/claude-auth/import POST providers › claude auth › import ```bash curl -X POST https://localhost:20128/api/providers/claude-auth/import \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/claude-auth/import-bulk POST providers › claude auth › import bulk ```bash curl -X POST https://localhost:20128/api/providers/claude-auth/import-bulk \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/claude-auth/zip-extract POST providers › claude auth › zip extract ```bash curl -X POST https://localhost:20128/api/providers/claude-auth/zip-extract \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/codex-auth/import POST providers › codex auth › import ```bash curl -X POST https://localhost:20128/api/providers/codex-auth/import \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/codex-auth/import-bulk POST providers › codex auth › import bulk ```bash curl -X POST https://localhost:20128/api/providers/codex-auth/import-bulk \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/codex-auth/zip-extract POST providers › codex auth › zip extract ```bash curl -X POST https://localhost:20128/api/providers/codex-auth/zip-extract \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/command-code/auth/apply POST providers › command code › auth › apply ```bash curl -X POST https://localhost:20128/api/providers/command-code/auth/apply \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/command-code/auth/callback POST providers › command code › auth › callback ```bash curl -X POST https://localhost:20128/api/providers/command-code/auth/callback \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/command-code/auth/start POST providers › command code › auth › start ```bash curl -X POST https://localhost:20128/api/providers/command-code/auth/start \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/command-code/auth/status GET providers › command code › auth › status ```bash curl https://localhost:20128/api/providers/command-code/auth/status \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/command-code/auth/status POST providers › command code › auth › status ```bash curl -X POST https://localhost:20128/api/providers/command-code/auth/status \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/expiration GET providers › expiration ```bash curl https://localhost:20128/api/providers/expiration \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### GET /api/providers/free-onboarding GET providers › free onboarding ```bash curl https://localhost:20128/api/providers/free-onboarding \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/free-onboarding POST providers › free onboarding ```bash curl -X POST https://localhost:20128/api/providers/free-onboarding \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/health-autopilot GET providers › health autopilot ```bash curl https://localhost:20128/api/providers/health-autopilot \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/health-autopilot/actions POST providers › health autopilot › actions ```bash curl -X POST https://localhost:20128/api/providers/health-autopilot/actions \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/health-matrix GET providers › health matrix ```bash curl https://localhost:20128/api/providers/health-matrix \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/import POST providers › import ```bash curl -X POST https://localhost:20128/api/providers/import \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/openrouter-stats GET providers › openrouter stats ```bash curl https://localhost:20128/api/providers/openrouter-stats \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### GET /api/providers/quota-windows GET providers › quota windows ```bash curl https://localhost:20128/api/providers/quota-windows \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/volcengine-plan/connect POST providers › volcengine plan › connect ```bash curl -X POST https://localhost:20128/api/providers/volcengine-plan/connect \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/volcengine-plan/connect/{sessionId}/cancel POST providers › volcengine plan › connect › › cancel ```bash curl -X POST https://localhost:20128/api/providers/volcengine-plan/connect/{sessionId}/cancel \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/volcengine-plan/connect/{sessionId}/code POST providers › volcengine plan › connect › › code ```bash curl -X POST https://localhost:20128/api/providers/volcengine-plan/connect/{sessionId}/code \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/volcengine-plan/connect/{sessionId}/identity POST providers › volcengine plan › connect › › identity ```bash curl -X POST https://localhost:20128/api/providers/volcengine-plan/connect/{sessionId}/identity \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/volcengine-plan/connect/{sessionId}/resend POST providers › volcengine plan › connect › › resend ```bash curl -X POST https://localhost:20128/api/providers/volcengine-plan/connect/{sessionId}/resend \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/providers/volcengine-plan/connect/{sessionId}/status GET providers › volcengine plan › connect › › status ```bash curl https://localhost:20128/api/providers/volcengine-plan/connect/{sessionId}/status \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### GET /api/providers/web-session-contract GET providers › web session contract ```bash curl https://localhost:20128/api/providers/web-session-contract \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` ### POST /api/providers/zed/discover POST providers › zed › discover ```bash curl -X POST https://localhost:20128/api/providers/zed/discover \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/zed/import POST providers › zed › import ```bash curl -X POST https://localhost:20128/api/providers/zed/import \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### POST /api/providers/zed/manual-import POST providers › zed › manual import ```bash curl -X POST https://localhost:20128/api/providers/zed/manual-import \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ## Payloads See the full OpenAPI specification at `GET /api/openapi/spec` or `docs/openapi.yaml` for detailed request/response schemas. ## Additional endpoints ### POST /api/providers/{id}/refresh Rotate / refresh OAuth tokens or re-validate credentials for a provider connection. Useful after token expiration or when credentials need to be renewed without deleting the connection. ```bash curl -X POST https://localhost:20128/api/providers/{id}/refresh \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ``` ### GET /api/provider-metrics Retrieve aggregated usage and performance metrics for all provider connections (request counts, error rates, latency percentiles, token usage). Used by dashboards and Auto-Combo scoring. ```bash curl https://localhost:20128/api/provider-metrics \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ``` **Response example:** ```json { "providers": [ { "id": "my-openai", "requestCount": 1240, "errorRate": 0.02, "p50LatencyMs": 340, "p99LatencyMs": 1200, "tokensIn": 500000, "tokensOut": 250000 } ] } ``` ### GET /api/providers/health-matrix Returns a health-matrix view of all providers with per-connection status, circuit-breaker state, and cooldown expiry. Useful for debugging routing decisions. ```bash curl https://localhost:20128/api/providers/health-matrix \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ```