Skip to main content
API requests use the X-API-Key header as the canonical credential shape. The TypeScript SDK sends that header when you pass apiKey to ApiClient. Hosted MCP uses the same API key as Authorization: Bearer cns_pk_... because remote MCP clients commonly support bearer-style auth. This is an API-key compatibility alias only. OAuth bearer tokens, JWT bearer tokens, and non-API-key bearer values are not supported. For testnet access, you can self-onboard at developers.shodai.network/portal and create an API key. You can use that key in your own integration or try it immediately in the Agreements API Playground. Production API keys are provisioned by your API operator, who hands the plaintext key to the recipient once.
Store the plaintext key when it is issued. The API stores only the hashed key afterward.

Send the API key

For Quickstart with TypeScript SDK, pass the key when constructing the client:
For Quickstart with MCP, configure the hosted server with a bearer-style API key:
For raw HTTP debugging, send the same value as X-API-Key:
For clients that cannot set custom API-key headers, the bearer-style alias also works:

Scopes and entitlements

API access is controlled by entitlements on the API principal. Testnet keys created through the Developer Portal are intended to include the default agreement and webhook read/write scopes. Manually provisioned principals should be checked for the scopes your integration needs. Entitlement modes are: If the principal has no active entitlement for the requested scope, the API returns 403 Forbidden.

Common authentication failures

Header casing

API auth header names are case-insensitive at the HTTP layer, but examples use X-API-Key consistently.