---
title: "Exchange for a service token"
method: POST
path: "/auth/exchange/token"
tags: ["Auth"]
---

# Exchange for a service token

`POST /auth/exchange/token`

## Request

- Base URL: `https://api.your-domain.com`
- URL: `https://api.your-domain.com/auth/exchange/token`
- Auth: none declared
- TypeScript: <https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/docs/auth/exchange/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Exchange the caller's token for a service token scoped to an AI application.

## Query parameters

- `app_id` integer, required: ID of the AI application to scope the token to.

## Response `200`

Successful Response

- string

## Other responses

- `401`: Missing or invalid authentication.
- `404`: No application exists with the given id.
- `422`: Validation Error

---

[API](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api.md) - [All operations](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/llms.txt) - [OpenAPI document](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/revisions/b53e89b98c2b?raw)
