aitododocs HamarosanAutonóm szállítás

REST API

Markdown

Alap URL: https://tkt.ideathon.me/v1, JSON be és ki; a /v1/projects/** Authorization: Bearer atk_… fejlécet vár.

Referenciakb. 7 perc
Ezen az oldalon

A store API végpontjai csak AITODO_STORE_API=1 mellett élnek, és csak loopback címen vagy Unix socketen érkező kérésnek válaszolnak. Séma: https://tkt.ideathon.me/openapi.json.

Részletek1 pont

A POST /v1/projects nyitott. Élesben a /v1/meta, a /v1/healthz, a /v1/projects/**, a /v1/operator/**, a /v1/feedback/** és ez a leírás érhető el. A lista a szerver route-jaiból generálódik; Swagger UI: https://tkt.ideathon.me/docs/api.

Végpontok#

végpontleírásszerep
GET /v1/healthzLiveness, always 200 (#424, owner decision: a busy database must not restart the container); status is degraded when the database cannot be read or its write lock is held, and db says which (server_db.probe: never waits, no token or secret)
GET /v1/metaPublished vocabularies: hint types, action types, enums, context guard and package version; who may register a project here (registration: open, invite or closed, #145); and the version of the feedback template (feedback_template_version, #149); error codes, environment variables and the tkt commands (#236)
POST /v1/projectsRegister a project; the response carries its first admin token, once
GET /v1/projects/{project_id}The project's settings (read), with its server AI budget (#334: the plan, granted, the share used; never tokens)read
PATCH /v1/projects/{project_id}Switch the server LLM on or off (admin, #131; on needs an LLM or an embedding endpoint on the server (#323), else 503), and its answer cache (#178; off deletes the project's cached answers)admin
DELETE /v1/projects/{project_id}Delete the project and everything the server keeps for it, in one transaction (admin, #143): its tokens, LLM usage, caps and cached answers, id counters and claim leasesadmin
GET /v1/projects/{project_id}/whoamiThe calling token: name, role, llm grant, expiry (any valid token)read
POST /v1/projects/{project_id}/tokensCreate a named token (admin); the response carries the token, onceadmin
GET /v1/projects/{project_id}/tokensThe project's tokens, revoked ones included: never a token value (admin)admin
PATCH /v1/projects/{project_id}/tokens/{name}Change a token's role, llm grant or expiry (admin)admin
DELETE /v1/projects/{project_id}/tokens/{name}Revoke a token; its name stays reserved (admin)admin
POST /v1/projects/{project_id}/storeCreate the project's store on the server (admin): an empty tkt store in its own git repository; the location becomes serveradmin
GET /v1/projects/{project_id}/storeWhere the store lives (repo, server, moving), its version (the HEAD of a server store) and when it last movedread
POST /v1/projects/{project_id}/cliRun tkt <argv> on the project's server store: {exit_code, stdout, stderr, files, store_version}, plus stage1 for ticket get, next and report context (the client runs Stage 2 on its own worktree)read
POST /v1/projects/{project_id}/store:importMove the store here from the repo (admin): {tar, bundle?, forceClaims?}; checked with tkt doctor while moving, then serveradmin
POST /v1/projects/{project_id}/store:exportFreeze the store for its way back to the repo (admin): moving, and its files as a taradmin
POST /v1/projects/{project_id}/store:releaseThe client has the store (admin): repo; the server copy goes to stores/.archive/admin
POST /v1/projects/{project_id}/llm:completeForward {prompt, schema} to the server's LLM; the answer object (an llm grant)
POST /v1/projects/{project_id}/llm/cache:lookupThe stored answers of the client's item keys (#179; an llm grant): {cache: on|off, entries: {key: {answer, generatedAt}}}
GET /v1/projects/{project_id}/llm/limitsThe project's and its tokens' caps, in input + output tokens, and the cache switch (admin)admin
PUT /v1/projects/{project_id}/llm/limitsSet the project's caps, or a token's with token; only the fields sent change, null clears one (admin)admin
GET /v1/projects/{project_id}/llm/statusWhether the caller's LLM calls can run, without one (#324, any token): the project's switch, the token's llm grant, whether the server has an LLM, its provider and place, why a call would be refused now (quota: its message, else null) and the plan's budget (#334: the plan, granted, the share used per month and day, the resets; never tokens)read
GET /v1/projects/{project_id}/llm/usageThe plan's budget as a share used (#334: never tokens), the calls made today and this month (UTC), the cache switch and its hits, and with byToken each token's calls (admin)admin
GET /v1/projects/{project_id}/embedThe server's embedding endpoint for this project: {id, model, place} (an llm grant)
POST /v1/projects/{project_id}/embedOne vector per text, in order: {id, place, vectors} (an llm grant)
POST /v1/projects/{project_id}/idsReserve the next number of a counter (write): above the counter and above floorread
GET /v1/projects/{project_id}/idsThe last number a counter handed out, taking nothing (read); 0 when noneread
GET /v1/projects/{project_id}/claimsThe live leases, oldest first (read); mine marks the caller's token'sread
POST /v1/projects/{project_id}/claims/{ulid}Create a lease (201), or renew or take over one (200); 409 ERR_ALREADY_CLAIMEDread
PUT /v1/projects/{project_id}/claims/{ulid}Renew the caller's own lease (write); 404 when it is gone, 409 for another ownerread
DELETE /v1/projects/{project_id}/claims/{ulid}Release a lease: its token, from any worktree, or an admin (write); 404 when noneread
GET /v1/operator/projectsEvery project: id, name, created, created by, how (an invite id, open (#145) or operator (#158)), token counts, last use, its AI plan and use (#334: plan {name, default}, ai {enabled, calls, monthCredits}, calls ever), what it takes on the disk (#261: diskBytes, its store with the history, archives, an import being built): never a tokenoperator
POST /v1/operator/projectsA project registered by the operator, whatever AITODO_REGISTRATION says (#158): the name rules of POST /v1/projects, its first admin token (as) in the reply, once; listed as created via operatoroperator
DELETE /v1/operator/projects/{project_id}What tkt server project-delete does: the project and every server row of it, in one transactionoperator
POST /v1/operator/projects/{project_id}/admin-tokenWhat tkt server admin-token does (recovery): a new admin token, shown onceoperator
POST /v1/operator/invitesA one-time registration code (arc_…), shown once; the server keeps only its hashoperator
GET /v1/operator/invitesEvery invite with its status (open, used, expired, revoked): never a codeoperator
DELETE /v1/operator/invites/{invite_id}Revoke an unused invite; the row stays (revoked)operator
POST /v1/operator/projects/{project_id}/store:unfreezeA move to the repo left half-done (moving): back to server, the store as it wasoperator
POST /v1/operator/projects/{project_id}/store:releaseA move left half-done (moving): finish it to repo; the server copy is archivedoperator
GET /v1/operator/pricesEvery model's price: credits per 1M input and per 1M output tokensoperator
PUT /v1/operator/pricesSet a model's price (new or changed); calls book their credits by it from then onoperator
GET /v1/operator/plansEvery plan with its values, whether it is the default and how many projects are on itoperator
POST /v1/operator/plansA new plan: a name, monthly credits and daily credits (-1 unlimited, 0 none)operator
PATCH /v1/operator/plans/{name}Change a plan's values; its projects spend by them from their next calloperator
DELETE /v1/operator/plans/{name}Delete a plan that no project and not the default uses (409 ERR_PLAN_IN_USE)operator
PUT /v1/operator/default-planMake a plan the default: every project without a plan of its own spends by itoperator
PUT /v1/operator/projects/{project_id}/planPut the project on a plan; null puts it back on the default planoperator
GET /v1/feedback/templateThe report template: kinds bug and idea, their sections (required, help), the title rule, the sections tkt feedback fills in itself, and the version
POST /v1/feedback/cliRun a reporter's call on the intake storewrite
Generálva a registryből: src/aitodo/api/selfdoc_entries/ref.py · ref.restv0.1.298