Skip to content
Endless Documentation
Files

Mint a file token

POST
/file-tokens

A short-lived token that opens stored files on the files host as you: the browser's cookie (no keys, checked per file), or a token scoped to the files of one use (a model reading your images, a provider running a generation, an MCP result). A token never opens more than you can read.

Authorization

headerAuthorizationBearer <esk_live_…>

A workspace API key created in workspace settings. It acts as the member who created it, narrowed to its abilities, projects and credit limit. Each operation names the ability it needs.

Scope: assets:read

Header Parameters

Endless-Api-Version?string

Pin the caller to an API major (1). Omit to accept the current version. A major this deployment cannot serve is refused with 400 unsupported_api_version.

Request Body

application/json
  1. body
purpose*string
Value in"cookie""provider""model""mcp""export""push"
keys?array<string>
Itemsitems <= 100

Response Body

OK

application/json
  1. response
token*string
expires_at*string
Example Request
curl -X POST 'https://api.endless.app/file-tokens' \  -H 'Content-Type: application/json' \  -d '{  "purpose": "cookie"}'
Example Response
{  "token": "string",  "expires_at": "string"}