---
title: "Token Endpoint"
method: POST
path: "/token"
tags: ["mcp"]
---

# Token Endpoint

`POST /token`

Accept the authorization code from client and exchange it for OAuth token.
Supports PKCE flow by forwarding code_verifier to upstream provider.

1. Call the token endpoint with PKCE parameters
2. Store the user's token in the db - and generate a LiteLLM virtual key
3. Return the token
4. Return a virtual key in this response

## Query parameters

- `mcp_server_name` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

> 14 revisions in range; 12 could not be searched.

- **2026-08-29** `404bba17aabe` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/flock/apis/litellm-api/changes/token/post.md)

---

[API](https://skmtc.dev/flock/apis/litellm-api.md) · [All operations](https://skmtc.dev/flock/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flock/litellm-api/revisions/404bba17aabe/schema)
