---
title: "Mint an integration token"
method: POST
path: "/oauth/token"
tags: ["Authentication"]
---

# Mint an integration token

`POST /oauth/token`

## Request

- Base URL: `https://api.quiva.ai`
- URL: `https://api.quiva.ai/oauth/token`
- Auth: none required
- TypeScript: <https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/docs/oauth/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Public. Cache the token for `expires_in`: every mint creates a session. The reply is not wrapped in `data`.

## Request body

- OAuthTokenRequest: Also accepted form-encoded. Send no Authorization header: the gateway refuses one it cannot resolve before this endpoint runs.
  - `grant_type` 'client_credentials', required
  - `client_id` string, required
  - `client_secret` string, required

## Response `200`

Token.

- OAuthTokenResponse
  - `access_token` string, required
  - `token_type` 'Bearer', required
  - `expires_in` integer, required: Seconds. Cache the token for this long.

## Other responses

- `400`: `invalid_request`.
- `401`: `invalid_client`. The text is the same for every cause.
- `503`: `temporarily_unavailable`. Retry.

## Changes

- **2026-10-08** `bcf3a5f49584`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/changes/oauth/token/post.md)

---

[API](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway.md) - [All operations](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/llms.txt) - [OpenAPI document](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/revisions/700eb1ace61a?raw)
