API Reference

Quick reference for all Egret API endpoints.

Base URL

https://api.getegret.com

Authentication

Most endpoints require one of:

  • API key: Authorization: Bearer egret_... or X-API-Key: egret_...
  • JWT access token: Authorization: Bearer eyJ... — required for API key management endpoints

Endpoints marked public require no authentication. See Authentication for details.

Endpoints

MethodPathAuthDescription
POST/auth/jwt/create/Login — obtain JWT access & refresh tokens
POST/auth/jwt/refresh/Refresh an access token
GET/v1/domains/PublicList all available domains
GET/v1/domains/{slug}/PublicDomain detail with embedded categories
GET/v1/domains/{slug}/categories/PublicList categories for a domain
GET/v1/models/API keyList available AI models
POST/v1/query/API keySubmit a RAG query (streaming or non-streaming)
GET/v1/sessions/recent/API keyList recent sessions
GET/v1/sessions/{id}/messages/API keyGet message history for a session
POST/v1/sessions/{id}/rename/API keyRename a session
DELETE/v1/sessions/{id}/delete/API keyDelete a session
GET/v1/orgs/JWTList organizations
GET/v1/orgs/{slug}/JWTGet organization detail
PATCH/v1/orgs/{slug}/JWTUpdate organization name or allowed domains
GET/v1/billings/api-keys/JWTList API keys
POST/v1/billings/api-keys/JWTCreate an API key
PATCH/v1/billings/api-keys/{id}/update/JWTSet or clear key expiration
POST/v1/billings/api-keys/{id}/rotate/JWTRotate (replace) an API key
GET/v1/billings/plans/PublicList available subscription plans
GET/v1/billings/subscription/API keyGet current subscription and credit quota
GET/health/PublicAPI health check

Response format

All endpoints return JSON. Successful responses use 200, 201, or 204. Errors return a JSON object with a detail field. See Error Codes for the full list.