API Reference

Tangle Router exposes an OpenAI-compatible REST API. All endpoints accept and return JSON.

Base URL

https://router.tangle.tools/v1

Authentication

Pass your API key in the Authorization header:

Authorization: Bearer sk-tan-your-key-here

Blueprint Routing

Route requests to Tangle operators running specific Blueprints. Pass as headers or in the request body.

X-Tangle-Routing

"operator" | "provider" | "auto" — control routing target

X-Tangle-Blueprint

On-chain Blueprint ID (uint) — route to operators under this Blueprint

X-Tangle-Service

On-chain service instance ID (uint) — route to a specific service

X-Tangle-Operator

Operator address (0x...) or slug — pin to a specific operator

Endpoints

POST/v1/chat/completions

Create a chat completion. Streams by default.

GET/v1/models

List all available models across operators.

POST/v1/embeddings

Generate text embeddings.

POST/v1/rerank

Rerank documents by relevance to a query.

POST/v1/images/generations

Generate images from text prompts.

POST/v1/images/edits

Edit or inpaint an existing image.

POST/v1/audio/speech

Generate speech from text (TTS).

POST/v1/audio/transcriptions

Transcribe audio to text (STT).

POST/v1/video/generate

Generate video from text or image prompts.

GET/v1/video/:jobId

Poll video generation job status.

POST/v1/fine_tuning/jobs

Create a fine-tuning job (LoRA, QLoRA, full).

GET/v1/fine_tuning/jobs

List fine-tuning jobs.

POST/v1/batch

Submit batch of requests for parallel processing.

GET/v1/operators

List active operators on the network.