OPTINROUTER / DEVELOPER DOCS

Quickstart & authentication

Install the public CLI, understand the closed access gate, and see the proposed inference request.

Contract preview · Production API access is closed. All /v1 endpoints currently return 401.Install CLI
01

Install the CLI

Node.js 22 or later is required. The CLI currently opens the access flow. It does not route inference, collect sessions or issue credentials.

sh
npm install -g https://optinrouter.ai/downloads/optinrouter-cli-0.3.1.tgz
optinrouter login
02

Observe the current boundary

This request is safe to try without a real key. It returns 401 Unauthorized because production access is closed. Never put a real credential into a shared example.

sh
curl -i https://optinrouter.ai/v1/models

# Current response: HTTP 401
# error.code: unauthorized
03

Proposed inference request

After onboarding opens, a workspace-scoped key will authorize eligible models. Organization policy always takes precedence over client hints. The header names and revision syntax below are preview contracts.

sh
curl https://optinrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $OPTINROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-OptinRouter-Policy: pol_engineering@3" \
  -d '{"model":"approved-model-id","messages":[{"role":"user","content":"Review this example"}],"stream":false}'
04

Keys and scopes

Workspace keys will bind identity, organization, limits and expiry. Provider BYOK credentials remain separate. A supplied object ID or policy header never grants cross-tenant access. Key revocation and current policy must be checked before dispatch and any action commits.

05

Inference is separate from contribution

The enterprise_private policy keeps data exchange off. Calling inference, enabling trace metadata or installing a local adapter does not authorize capture for sale. A commercial data program needs its own accepted agreement.

Contracts & examples

Download the preview, validate its shape locally and review the capability limits before planning an integration.

OpenAPI preview

OptinRouter AI guide

Product and developer guidance.

A good place to start

What would you
like to know?

Ask about public APIs, policies, grammars, context actions or the product. This guide uses approved information and can’t reveal private details or take actions.

Recent messages stay in this page’s memory. Reload or reset to clear them here.