SDKs and CLI
exoCortex distributes three clients for the REST API v1. You download them directly from the API and add them to your project:
| Client | Address | Requirements |
|---|---|---|
| JavaScript | https://exocortex-api.ai-exo-cortex.com/sdk/exocortex.js |
A runtime with fetch, for example Node.js 18 or later |
| Python | https://exocortex-api.ai-exo-cortex.com/sdk/exocortex.py |
The requests package |
| bash CLI | https://exocortex-api.ai-exo-cortex.com/sdk/exo-cli |
curl and jq |
All of them read the API key you pass them; none of them stores it. They automatically create an Idempotency-Key when you open a ticket.
JavaScript
Section titled “JavaScript”import { ExoClient, ExoApiError } from './exocortex.js';
const exo = new ExoClient({ apiKey: process.env.EXO_API_KEY });
try { const created = await exo.tickets.create({ subject: 'Printer offline', description: 'Floor 2, room 204', priority: 'Medium', }); const { ticket } = await exo.tickets.get(created.ticket_key); await exo.tickets.comment(ticket.key, 'Toner replaced.');} catch (err) { if (err instanceof ExoApiError && err.code === 'rate_limited') { // retry after err.retryAfter seconds } else throw err;}ExoApiError exposes status, code, retryAfter and the response body in body.
Python
Section titled “Python”import osfrom exocortex import ExoClient, ExoApiError
exo = ExoClient(api_key=os.environ['EXO_API_KEY'])
try: created = exo.tickets.create(subject='Printer offline', description='Floor 2, room 204') ticket = exo.tickets.get(created['ticket_key'])['ticket'] exo.tickets.comment(ticket['key'], 'Toner replaced.')except ExoApiError as err: print(err.status, err.code, err.retry_after)curl -fsSL https://exocortex-api.ai-exo-cortex.com/sdk/exo-cli -o exo-cli && chmod +x exo-cliexport EXO_API_KEY='nhk.<keyid>.<secret>'
./exo-cli ticket-create "Printer offline" "Floor 2, room 204" Medium./exo-cli ticket-get ACME-1042./exo-cli ticket-comment ACME-1042 "Toner replaced."With EXO_BASE_URL you point the CLI to a different API address.
Migrating from the old SDK
Section titled “Migrating from the old SDK”The NHClient and NHError classes are deprecated aliases of ExoClient and ExoApiError. The new SDK sends the key in Authorization: Bearer and no longer sends the tenant, which the API derives from the key. The widgets and mapping helpers have been removed.