@wraith-protocol/sdk wraps every endpoint — most integrations never call the API directly — but you can use it directly for lower-level control or to build integrations in languages other than TypeScript.
Base URL
Authentication
Include your API key as a Bearer token in every request:401 Unauthorized.
Bring your own model (BYOM)
By default, agents use Wraith Protocol’s hosted AI model. To use your own OpenAI or Anthropic key instead, pass these optional headers:X-AI-Provider: openai, claude, gemini.
BYOM headers are per-request. You can switch providers between requests on the same agent without reconfiguring anything.
Error responses
All errors return a JSON body withmessage and statusCode:
Error codes
| Status code | Meaning |
|---|---|
400 | Bad request — missing or invalid parameters, failed signature verification |
401 | Unauthorized — missing or invalid API key |
404 | Not found — agent, invoice, or conversation does not exist |
409 | Conflict — resource already exists (e.g., name already registered) |
500 | Server error — something unexpected went wrong on the TEE server |