TypeScript SDK reference
⚠️
Preview — this feature is being built; the design below is the spec.
Method-by-method reference for @syntic/sdk. Each page lists the methods for one resource, the endpoint each calls, what it returns, and an example.
Client options
| Option | Default | Meaning |
|---|---|---|
apiKey | process.env.SYNTIC_API_KEY | Inference key. |
baseURL | https://app.syntic.ai/v1 | Override for tests. |
timeout | 600,000 ms | Per request. |
maxRetries | 2 | Same retry rules as Python, honouring Retry-After. |
defaultHeaders | {} | Added to every request. |
fetch | global fetch | Supply your own for proxies or older runtimes. |
dangerouslyAllowBrowser | false | Refuses to run in a browser unless set, because a browser would expose your key. |
import Syntic from '@syntic/sdk'
const client = new Syntic({ maxRetries: 4, defaultHeaders: { 'syntic-version': '2026-11-01' } })Runs on Node.js 18+, Deno, Bun and edge runtimes that provide fetch.
Errors
All API errors extend Syntic.APIError with status, code, requestId and error (the parsed envelope). Subclasses mirror the Python ones: BadRequestError, AuthenticationError, QuotaExhaustedError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, and APIConnectionError for network failures.
try {
await client.chat.completions.create({ model: 'Amara S1.2', messages: [] })
} catch (err) {
if (err instanceof Syntic.APIError) console.error(err.status, err.code, err.requestId)
else throw err
}Was this page helpful?