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.
Send the API key
For Quickstart with TypeScript SDK, pass the key when constructing the client:X-API-Key:
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 useX-API-Key consistently.
Related pages
- Quickstart with TypeScript SDK
- Quickstart with MCP
- TypeScript client reference
- Errors and troubleshooting
- Use the API Reference group in the sidebar for generated request and response details.