Learn how to authorize requests to the Hyperspell API
Authorization: Bearer <token>
header. You can generate an API key in the Dashboard.
Hyperspell is a multi-tenant platform, and you can have multiple users in your app — each with their unique data and query history. For that reason, in most cases you want to identify the user making the request. You don’t have to create users explicitly, you simply have to pass on the user id you have internally assigned to your user. There are two different ways of doing this:
X-As-User: <user_id>
header in your request. This will make Hyperspell assume that the user id is the one making the request. When using the SDK, you can set the user id like this:
/auth/user_token
endpoint or the SDK and pass the ID of your user:
/auth/user_token
endopint is the only endpoint that is only accessible with an app token. If you do not use a backend to generate user tokens, or use a service like Clerk or Auth0 to manage your users, you can also configure them to provide a user token to your frontend.