Skip to main content
POST
/
tokens
JavaScript
import Smithery from '@smithery/api';

const client = new Smithery({
  apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted
});

const createTokenResponse = await client.tokens.create();

console.log(createTokenResponse.token);
{
  "token": "<string>",
  "expiresAt": "2024-01-01T01:00:00.000Z"
}

Documentation Index

Fetch the complete documentation index at: https://smithery.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Smithery API key as Bearer token

Body

application/json
policy
object[]

Constraint objects to restrict the token. Each constraint may include a ttl field (max 24 hours). Default TTL is 1 hour. Maximum is 24 hours.

Minimum array length: 1
organizationId
string

Optional organization ID to scope the token to. When provided, the token is minted with org context. The authenticated user must be an admin or owner of the organization.

Example:

"org_01H1234567890"

Response

Token created successfully

token
string
required

The signed service token.

expiresAt
string
required

ISO 8601 timestamp when the token expires.

Example:

"2024-01-01T01:00:00.000Z"