Documentation
API Overview
View .mdOpenAPI

Introduction

The weights.fyi API classifies web pages, runs batches of any size, trains the classifier on your own labelled pages, runs staged compute plans over your data, and serves language models through OpenAI-compatible chat. It speaks JSON over HTTPS, and a program authenticates each call with an API key.

Status. Written on 2026-11-14 against this service's router and its OpenAPI description; the authentication summary was corrected on 2026-11-16.

Base URL

SurfaceBase URLUse it for
Native APIhttps://weights.fyi/run/v1Every call in this reference.
OpenAI-compatiblehttps://weights.fyi/run/v1/proxyAn OpenAI client or SDK: set it as the base URL, then call /models and /chat/completions.

The reference names each call by its method and path, such as GET /v1/models; put https://weights.fyi/run in front of the path to call it. No LLM chat model is available on this service yet.

API surfaces

SurfaceMain callsGuide
Account and keysGET /v1/tokens/self, POST /v1/tokens, GET /v1/workspacesAuthentication
Credit and usageGET /v1/usage, GET /v1/usage.csv, POST /v1/credit/topupsPrices and billing
Models and quotesGET /v1/models, GET /v1/quote, GET /v1/capabilitiesModels and capabilities
ClassifyPOST /v1/classifyClassify pages
Jobs and resultsPOST /v1/jobs, GET /v1/jobs/{job_id}, GET /v1/jobs/{job_id}/resultsJobs, progress and results
Datasets and fine-tuningPOST /v1/datasets, PUT /v1/datasets/{dataset_id}/content, POST /v1/jobsFine-tune a model
Compute plans and streamsPOST /v1/compute/plans, POST /v1/streams/{stage_id}/packs, GET /v1/compute/eventsPython SDK
LLM endpointsPOST /v1/endpoints, POST /v1/chat/completionsLLM endpoints
Tracing and exportsGET /v1/jobs/{job_id}/logs, GET /v1/traces, POST /v1/trace-sinksTracing and exports

Every call has its own page in the reference: its request, its answer, its errors and an example.

Authentication

Send an API key as a bearer token on every call a program makes:

text
Authorization: Bearer $WEIGHTS_API_KEY

Make a key on your panel under API tokens; it is shown once. Each key holds scopes (read, submit, manage) and belongs to one workspace. An API key is the recommended credential, not the only one: the panel's own calls ride a browser session, a deployment with an identity issuer also takes its OIDC bearer tokens, and a worker you enroll has credentials of its own. Authentication covers all four, scopes, rotation and keeping keys safe.

Example

Classify two pages in one call:

sh
curl -s https://weights.fyi/run/v1/classify \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: first-call-1" \
  -d '{"model": "laya-page-role", "pages": [{"text": "Senior data engineer, Utrecht. Apply today.", "id": "p1"}, "All open positions: 24 results. Filter by city or team."]}'

When the model is ready, the answer is 200 with a label and its probabilities for each page (abridged):

json
{
  "job_id": "job_a9f211eac4050afa06474fa0",
  "status": "SUCCEEDED",
  "model": "laya-page-role",
  "results": [
    {"seq": 1, "id": "p1", "label": "detail", "status": "done",
     "probabilities": {"detail": 0.912, "listing": 0.041, "landing": 0.022, "not_vacancy": 0.019, "unresolved": 0.006}},
    {"seq": 2, "id": null, "label": "listing", "status": "done",
     "probabilities": {"detail": 0.027, "listing": 0.893, "landing": 0.061, "not_vacancy": 0.011, "unresolved": 0.008}}
  ]
}

Otherwise it is 202 with the job to follow: wait Retry-After seconds, then read the job (Classify pages). A refusal is JSON with an error code (API errors).

OpenAPI

An OpenAPI 3.1 description of every call this service answers, generated from its router, is public at /openapi.json and at its well-known twin, /.well-known/openapi.json; neither needs a key:

text
https://weights.fyi/run/openapi.json
https://weights.fyi/run/.well-known/openapi.json

Each operation carries its summary, its scope (x-required-scope), typed parameters, request and answer schemas with examples, and the error codes it answers. Import it into an API client or a client generator. The LLM endpoint calls appear in it once a chat model is running on this service.

Versioning

The version, v1, is part of every path, and GET /v1/capabilities answers "api_version": "v1" with what this service does today. Calls are added as they go live, and each reference page's History section dates the changes to its call. Read answers tolerantly: an answer may gain fields.