SDK Installation
The official SDKs are a thin wrapper over the REST API: they handle authentication, JSON conversion, pagination, file uploads and automatic retries on 429/5xx responses for you. Each SDK is pinned to https://api.incapon.com/v2.4, so a backwards-incompatible change in the API never silently breaks your code.
Install the package
npm install @incapon/node
pip install incapon-python
go get github.com/incapon/incapon-go
The Node.js SDK supports Node 18 and later, the Python SDK Python 3.9 and later, the Go SDK Go 1.21 and later. The Python package is published on PyPI as incapon-python but imported with import incapon.
Configure the key
Every SDK reads the INCAPON_API_KEY environment variable by default. Define that variable in your deployment environment instead of writing the key into code. If you work with several teams, you can also pass the key explicitly when creating the client.
export INCAPON_API_KEY=inc_live_xxxxxxxxxxxxxxxx
Verify the connection
The easiest check is calling the balance endpoint, which costs no credits. If a response comes back, the key, the network and the scopes are all right. If you get a 401, check the key; if you get a 403, check the key's scopes and IP restrictions.
import incapon client = incapon.Client() # reads INCAPON_API_KEY balance = client.credits.balance() print(balance.available_usd)
Client options
| Option | Default | Description |
|---|---|---|
| apiKey | INCAPON_API_KEY | The key used for requests. |
| timeout | 60 s | Timeout of a single request; raise it for large PDF uploads. |
| maxRetries | 3 | Number of attempts with exponential backoff on 429, 500 and 503 responses. |
| baseUrl | https://api.incapon.com/v2.4 | Change it only if you run behind a proxy. |
In Python the same options are passed as api_key, timeout, max_retries and base_url.
Idempotency-Key to every request, so an automatic retry after a network error never creates the same monitor or job twice.For the shape of error objects and manual retries, continue to Error Codes.