SDKs & toolsTypeScript reference

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

OptionDefaultMeaning
apiKeyprocess.env.SYNTIC_API_KEYInference key.
baseURLhttps://app.syntic.ai/v1Override for tests.
timeout600,000 msPer request.
maxRetries2Same retry rules as Python, honouring Retry-After.
defaultHeaders{}Added to every request.
fetchglobal fetchSupply your own for proxies or older runtimes.
dangerouslyAllowBrowserfalseRefuses 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?