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
| Surface | Base URL | Use it for |
|---|---|---|
| Native API | https://weights.fyi/run/v1 | Every call in this reference. |
| OpenAI-compatible | https://weights.fyi/run/v1/proxy | An 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
| Surface | Main calls | Guide |
|---|---|---|
| Account and keys | GET /v1/tokens/self, POST /v1/tokens, GET /v1/workspaces | Authentication |
| Credit and usage | GET /v1/usage, GET /v1/usage.csv, POST /v1/credit/topups | Prices and billing |
| Models and quotes | GET /v1/models, GET /v1/quote, GET /v1/capabilities | Models and capabilities |
| Classify | POST /v1/classify | Classify pages |
| Jobs and results | POST /v1/jobs, GET /v1/jobs/{job_id}, GET /v1/jobs/{job_id}/results | Jobs, progress and results |
| Datasets and fine-tuning | POST /v1/datasets, PUT /v1/datasets/{dataset_id}/content, POST /v1/jobs | Fine-tune a model |
| Compute plans and streams | POST /v1/compute/plans, POST /v1/streams/{stage_id}/packs, GET /v1/compute/events | Python SDK |
| LLM endpoints | POST /v1/endpoints, POST /v1/chat/completions | LLM endpoints |
| Tracing and exports | GET /v1/jobs/{job_id}/logs, GET /v1/traces, POST /v1/trace-sinks | Tracing 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:
Authorization: Bearer $WEIGHTS_API_KEYMake 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:
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):
{
"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:
https://weights.fyi/run/openapi.json
https://weights.fyi/run/.well-known/openapi.jsonEach 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.