Existing SDK endpoint: uses X-HeroUI-Agent-Key, camelCase JSON, numeric expiresAt (Unix milliseconds), and {error, code?} errors. Derive identity from your application's trusted session. Never accept an arbitrary identity from the browser. Prefer createAuthToken from @heroui/agent/server.
api.heroui.pro/v1/agents/{agentId}/auth-tokensSend the request to see the live response from the Agents API.
IntegrationKey An Agents workspace key with auth_tokens:create. Server-side only.
In: header
The Agent targeted by this workspace API key request.
application/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.heroui.pro/v1/agents/string/auth-tokens" \ -H "Content-Type: application/json" \ -d '{ "identity": { "id": "string", "type": "user" } }'{
"expiresAt": 0,
"token": "string"
}{
"code": "string",
"error": "string"
}{
"code": "string",
"error": "string"
}{
"code": "string",
"error": "string"
}{
"code": "string",
"error": "string"
}{
"code": "string",
"error": "string"
}1 <= length <= 200Server-assigned descriptive labels. Serialized size at most 4 KiB; never used for authorization or prompt context.