Libraries

Synex is a plain HTTP + JSON API you can call from any language or framework — no SDK required. There is no official first-party client library yet, so the documentation shows raw requests for cURL, JavaScript (fetch), and Python (requests). The small helpers below give you a typed-enough starting point in each.

A tiny client

Wrap the base URL and your API key once, then reuse it for every call. These are the exact patterns used throughout the resource docs.

Minimal client

# Keep these in your shell profile or a .env file
export SYNEX_API_KEY="synex_sk_..."
export SYNEX_API="https://api.synexcloud.com/v1"

# Then every call is just:
curl -s $SYNEX_API/ontologies -H "Authorization: Bearer $SYNEX_API_KEY"

Conventions worth building in

Whichever language you use, bake these into your client once:

  • Auth — send Authorization: Bearer synex_sk_... on every request. See Authentication.
  • Idempotency — add an Idempotency-Key header to POSTs you might retry. See Idempotency.
  • Pagination — follow next_cursor until has_more is false. See Pagination.
  • Errors — branch on error.type then error.code; retry 429/5xx with backoff. See Errors.

Was this page helpful?