Seek AISeek AI
API reference

Seek AI agent API

Every endpoint of the agent channel — the authorization flow, the project API, the MCP server, and the stable error codes. This page stays in sync with the agent guide by construction.

Base URLs

Four addresses power the whole channel.

REST base
https://seekai.dev/api/agent
MCP
https://seekai.dev/api/mcp
Agent guide
https://seekai.dev/api/agent/guide
Agent skill
https://seekai.dev/skill.md

Response envelope

Every REST response uses the same envelope. Branch on data.error, never on message.

{
  "code": 0,            // 0 = success; anything else = failure
  "message": "…",       // human-readable, NOT a contract — never branch on it
  "data": {             // payload on success; on failure data.error holds a
    "error": "…"        // stable machine code (see Error codes)
  }
}

Authorization flow

Method & pathAuthPurpose
POST/api/agent/registerNoneStart authorization; returns authorization_url, user_code, device_code, guide_url
GET/authorize/:claim_idOwner sessionThe human approves or denies the claim here
POST/api/agent/tokendevice_codeExchange device_code → Bearer project token
GET/api/agent/guideNoneThe complete agent guide (markdown)
GET/api/agent/schemaNoneThe content-payload JSON Schema (application/schema+json)

Project API (Bearer token)

Method & pathAuthScopePurpose
GET/api/agent/projectBearer tokenproject.readRead project state
GET/api/agent/project/statusBearer tokenproject.readRead review status
POST/api/agent/projectBearer tokenproject.updateUpdate basic fields (name/description/website/category/pricing/notes)
POST/api/agent/project/submitBearer tokenproject.submit(Legacy) ensure the listing exists — approval already does this; call only if status says no listing
GET/api/agent/project/content/contractBearer tokenproject.updateMachine-readable contract (JSON schema + example + vocabularies)
POST/api/agent/project/contentBearer tokenproject.updateSubmit the full listing content — English required, optional zh locale (256KB limit)
GET/api/agent/project/badgeBearer tokenproject.badge.installOfficial badge snippet
POST/api/agent/project/badge/verifyBearer tokenproject.badge.verifyVerify the deployed badge backlink (checks the registered URL)
POST/api/agent/project/token/rotateBearer tokenRotate the token (old one stops immediately)
POST/api/agent/project/authorizationBearer tokenRevoke this authorization

Public directory endpoints

Method & pathAuthPurpose
GET/api/directory/taxonomy?view=flat&locale=enNoneControlled vocabularies — the only accepted category/tag/audience slugs

Error codes

Stable machine codes — only ever added, never redefined.

codeHTTPMeaning
invalid_payload400Body failed schema/taxonomy validation — message lists the failing fields
authorization_pending400Owner has not approved yet (keep polling)
slow_down429Polling too fast — honor the 5s interval
unauthorized401Missing/invalid token
insufficient_scope403Token lacks the required scope (e.g. project.update for content) — the owner can grant it in /settings/my-tools → Agent authorization
project_not_found404No listing yet — approval creates it only when project.submit is granted; otherwise call POST /api/agent/project/submit first
duplicate_domain409Already listed or reserved: pending requests clear in ~15 min; approved-but-unexchanged claims release once the 24h window closes; if the listing exists it is managed (and its token re-issued) in /settings/my-tools → Agent authorization
quota_exceeded / rate_limited409/429Owner hit submission capacity or cadence (free tier: 24h between submissions)
conflict409State transition race — re-read state and retry
expired_token400The 24h exchange window closed — register again; dead claims release automatically, and an existing listing keeps its data (its owner can re-issue the token instead)

Related