# SeaChat Developer Docs

Use SeaChat's public gateway for model calls, threads, tools, files, Play apps, usage, and capability-aware agents.

## Quick Start

### Get an API key

Create a project key from the SeaChat app, or automate it with a logged-in web session token that has API-key write scope. The API key token is returned once.

```bash
export SEACHAT_SESSION_TOKEN="<web-session-token>"

curl https://seachat.ai/api/keys \
  -H "Authorization: Bearer $SEACHAT_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "docs quickstart",
    "scopes": ["model:invoke", "usage:read"],
    "spendLimitMicros": 5000000
  }'

export SEACHAT_API_KEY="sk-seaverse-..."
```


### Call the Responses API

SeaRouter exposes an OpenAI-style Responses endpoint through SeaGate. Provider credentials stay server-side; clients send only the SeaChat key.

```bash
curl https://seachat.ai/api/searouter/llm/v1/responses \
  -H "Authorization: Bearer $SEACHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "input": "Write a concise launch checklist for an agent API."
  }'
```


### Discover capability metadata

Agents should read the credential-aware catalog before choosing routes. It returns access, required scopes, stability, runtime safety, schemas, and examples.

```bash
curl "https://seachat.ai/api/seagate/v1/capabilities?runtime=true&includeDenied=true" \
  -H "Authorization: Bearer $SEACHAT_API_KEY"
```


### Verify usage attribution

After the first call, query usage with the same key. Use `x-request-id` on retries so support, billing, and logs share one correlation id.

```bash
curl https://seachat.ai/api/searouter/v1/usage/summary \
  -H "Authorization: Bearer $SEACHAT_API_KEY"
```


## Agent Entrypoints

- `/llms.txt` - compact page index and rules for agents.
- `/llms-full.txt` - full Markdown corpus.
- `/api/capabilities.json` - public route catalog with scopes, schemas, and examples.
- `/api/openapi.json` - OpenAPI 3.1 public developer API surface.
