# SeaChat Developer Docs

Build on the SeaChat Platform API: a single Bearer key over the stable /v1 facade for chat, multimodal, threads, tools, files, documents, and usage, with a typed TypeScript SDK.

## Quick Start

### Install the SDK

The TypeScript SDK wraps the public `/v1` API. It ships dual ESM + CJS with bundled types and runs on Node 18+, Bun, Deno, or any runtime with a global `fetch`.

```bash
npm install @seachat/platform-sdk
# or: bun add @seachat/platform-sdk
```


### Create the client

Every request carries a SINGLE credential: `Authorization: Bearer <apiKey>`. The SDK never also sends `x-api-key`. The base URL defaults to `https://seachat.ai`; all paths live under `/v1`.

```bash
import { SeaChat } from "@seachat/platform-sdk";

const client = new SeaChat({ apiKey: process.env.SEACHAT_API_KEY! });
```


### Make your first chat call

`client.chat.completions.create` posts to `/v1/chat/completions` (OpenAI-compatible). Pass `stream: true` to get an `AsyncIterable` of chunks instead of one result.

```bash
const completion = await client.chat.completions.create({
  model: "claude-opus-4-8",
  messages: [{ role: "user", content: "Greet the ocean in one short line." }],
  max_tokens: 64,
});
console.log(completion.choices[0].message.content);
```


### Or call /v1 directly with curl

Every SDK method maps to a plain HTTP route. The same first call over curl, using the same single Bearer credential:

```bash
curl https://seachat.ai/v1/chat/completions \
  -H "Authorization: Bearer $SEACHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "messages": [{"role":"user","content":"Greet the ocean in one short line."}],
    "max_tokens": 64
  }'
```


## 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.
