Skip to main content

auth.status

Get the current authentication status for all providers.

Request

{"jsonrpc":"2.0","id":1,"method":"auth.status","params":{}}

Parameters

No parameters required.

Response

enabled_providers
array
required
Array of enabled providers: ["openai", "openrouter", "antigravity"]
has_openai_token
boolean
required
Whether OpenAI OAuth token is configured
has_openrouter_key
boolean
required
Whether OpenRouter API key is configured
has_antigravity_token
boolean
required
Whether Antigravity OAuth token is configured
antigravity_profile
object
Antigravity user profile object (if authenticated)

Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "enabled_providers": ["openai", "openrouter"],
    "has_openai_token": true,
    "has_openrouter_key": true,
    "has_antigravity_token": false,
    "antigravity_profile": null
  }
}

auth.connect.openai

Initiate OpenAI OAuth login flow. In RPC mode, auth URLs/device codes are emitted as events.

Request

{"jsonrpc":"2.0","id":2,"method":"auth.connect.openai","params":{"mode":"device_code"}}

Parameters

mode
string
Login mode: "auto", "browser", or "device_code". Defaults to "auto".
  • "auto" - Automatic browser launch (non-RPC mode)
  • "browser" - Browser-based OAuth flow
  • "device_code" - Device code flow (recommended for RPC mode)
originator
string
Optional originator identifier for tracking

Response

provider
string
required
Always returns "openai"
login_method
string
required
The login method used: "browser" or "device_code"
account_id
string
required
OpenAI account ID

Events Emitted

During the authentication flow, the server emits:
  • auth.flow.started - Flow initiated
  • auth.flow.url - Browser URL (for browser mode)
  • auth.flow.device_code - Device code details (for device code mode)
  • auth.flow.completed - Authentication succeeded
  • auth.flow.failed - Authentication failed
  • state.changed - Runtime state updated

Example

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "provider": "openai",
    "login_method": "device_code",
    "account_id": "user-abc123"
  }
}
In RPC mode, listen for auth.flow.device_code events:
{
  "jsonrpc": "2.0",
  "method": "event",
  "params": {
    "type": "auth.flow.device_code",
    "timestamp": "2026-01-01T00:00:00.000Z",
    "payload": {
      "provider": "openai",
      "verification_url": "https://auth.openai.com/activate",
      "user_code": "ABCD-EFGH",
      "interval_seconds": 5,
      "expires_in_seconds": 600
    }
  }
}

auth.connect.antigravity

Initiate Antigravity OAuth login flow.

Request

{"jsonrpc":"2.0","id":3,"method":"auth.connect.antigravity","params":{}}

Parameters

No parameters required.

Response

provider
string
required
Always returns "antigravity"
profile
object
required
Antigravity user profile object

Events Emitted

  • auth.flow.started
  • auth.flow.url - Browser URL for OAuth
  • auth.flow.completed
  • auth.flow.failed
  • state.changed

Example

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "provider": "antigravity",
    "profile": {
      "id": "user_xyz789",
      "email": "[email protected]",
      "name": "Alice"
    }
  }
}

auth.set.openrouter_key

Configure OpenRouter API key. This will fetch and cache the model catalog.

Request

{"jsonrpc":"2.0","id":4,"method":"auth.set.openrouter_key","params":{"api_key":"sk-or-v1-..."}}

Parameters

api_key
string
required
OpenRouter API key (must be non-empty)

Response

configured
boolean
required
Always returns true if key was set
model_count
number
required
Number of models discovered from OpenRouter
source
string
required
Source of model catalog: "api" or "fallback"

Example

{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "configured": true,
    "model_count": 127,
    "source": "api"
  }
}
The API key is stored unencrypted in the runtime state file. Ensure proper file permissions.

auth.set.exa_key

Configure Exa API key for the built-in search tool, or disable it by passing "skip".

Request

{"jsonrpc":"2.0","id":5,"method":"auth.set.exa_key","params":{"api_key":"exa_..."}}

Parameters

api_key
string
required
Exa API key, or the literal string "skip" to disable Exa search

Response

configured
boolean
required
true if key was set, false if skipped
skipped
boolean
required
true if the user passed "skip"

Example (Set Key)

{
  "jsonrpc": "2.0",
  "id": 5,
  "result": {
    "configured": true,
    "skipped": false
  }
}

Example (Skip)

{"jsonrpc":"2.0","id":6,"method":"auth.set.exa_key","params":{"api_key":"skip"}}
{
  "jsonrpc": "2.0",
  "id": 6,
  "result": {
    "configured": false,
    "skipped": true
  }
}

Build docs developers (and LLMs) love