API / SDK

This page describes how to integrate with TPIX programmatically.

Base URL

Use your TPIX server root as the base URL. The REST API lives under /api/v1.

Authentication

All /api/v1 endpoints require authentication. Use a permanent API key created in Settings → API Keys and send it as a Bearer token:

Authorization: Bearer <api-key>

Device Code login is no longer supported. API keys do not expire unless revoked.

Rate Limits

Each user has a default rate limit of 30 REST API requests per minute. Administrators can adjust this per user.

When the limit is exceeded, the API returns:

{"error":"rate limit exceeded"}

with HTTP status 429 Too Many Requests.

Core Endpoints

Detailed request/response schemas are not documented here yet. For now, refer to the tpix-cli Go SDK as the authoritative client implementation.

Method Path Description
GET /api/v1/profile Current user profile and accessible namespaces
GET /api/v1/search?q={query} Search packages
GET /api/v1/namespaces/{namespace}/index.json Typst-format package index for a namespace
GET /api/v1/packages/{namespace}/{name} Package metadata and versions
GET /api/v1/packages/{namespace}/{name}/{version}/dependencies Dependencies for a package version
POST /api/v1/packages/upload Upload a package archive
GET /api/v1/download/{namespace}/{name}/{version} Download a package archive

Uploads are subject to the current user's package-size limit and the target namespace's storage quota.

Go SDK

The tpix-cli project can be used both as a CLI and as a Go SDK. It exposes the same search, download, upload, and Zotero operations used by the CLI, so Go tools can import it directly instead of reimplementing the REST calls.

Example

curl -H "Authorization: Bearer $TPIX_API_KEY" \
  "https://your-tpix-server/api/v1/search?q=chart"