# Check an agent key

Source: https://immiscible.fly.dev/docs/api/get-v1-cli-agent-key

`GET /v1/cli/agent-key`

Which agent and workspace an agent key is for, whether the agent is active, how many rules it has, and whether a rule waits for a second owner. Records nothing. `immiscible doctor` uses it.

## Authentication

Agent key. An agent-scoped key (`ask_...`) bound to exactly one agent, or an OAuth access token (`aat_...`) issued to an MCP client for that agent, sent as `Authorization: Bearer`. An agent key may ask, poll and settle. It can never approve, widen a mandate or lift a freeze.

## Request

curl:

```bash
curl "https://immiscible.fly.dev/v1/cli/agent-key" \
  -H "authorization: Bearer $IMMISCIBLE_AGENT_KEY"
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/v1/cli/agent-key', {
  headers: {
    authorization: `Bearer ${process.env.IMMISCIBLE_AGENT_KEY}`,
  },
});
const data = await res.json();
console.log(res.status, data);
```

Python:

```python
import os
import requests

res = requests.get(
    "https://immiscible.fly.dev/v1/cli/agent-key",
    headers={
        "authorization": f"Bearer {os.environ['IMMISCIBLE_AGENT_KEY']}",
    },
)
print(res.status_code, res.json())
```

## Response

```json
{
  "agent": {
    "id": "agt_15cf4adcf8235ff0b0100202",
    "name": "Invoice agent",
    "status": "active",
    "tier": "intern"
  },
  "workspace": {
    "id": "ws_fa833074ebeb45e8",
    "name": "Quayside"
  },
  "key": {
    "id": "key_24c6dfd580ab",
    "createdAt": "2026-10-06T12:43:22.870Z"
  },
  "rules": 1,
  "waitingForSecondOwner": 0,
  "covers": [
    {
      "kind": "payment",
      "actions": null
    }
  ],
  "pending": null,
  "canAct": true
}
```
