Интеграции
Инструкции для LLM и агентов
Готовый текст, по которому агент сам найдёт модели, оценит цену, запустит задачи, дождётся результата и свяжет модели в цепочку.
Как передать агенту
#- Дайте агенту ссылку https://lumv.app/llms-full.txt — полную инструкцию с актуальным каталогом и схемами всех моделей — или вставьте текст ниже. Короткий указатель для поиска — llms.txt.
- Передайте ключ через переменную окружения
LUMV_API_KEYили хранилище секретов, а не в тексте промпта. - Укажите бюджет и число результатов: агент обязан оценить цену через estimate до запуска.
Готовая инструкция
#Инструкция на английском языке (English): так модели точнее следуют правилам. Она совпадает со статической частью llms-full.txt.
# lumv.app API guide for LLMs and automated agents
> lumv.app generates images, video, 3D models, speech, sound effects and music, and serves text chat models.
> Agents use a personal API key. Generations are asynchronous jobs (estimate, start, poll, download) at
> /v1/generations; text models use the OpenAI-compatible /v1/chat/completions and /v1/responses.
> Money is counted in credits: 1 credit = 1 RUB = 100 kopecks. Every *Cents field is an integer number of kopecks.
## Access
- Origin: https://lumv.app. API base URL, also for OpenAI SDKs: https://lumv.app/v1.
- The user signs in at https://lumv.app, funds a wallet and creates a personal key at
https://lumv.app/account/api/keys. The full key (sk-lumv-...) is shown once. A key can have an expiry date and a
monthly spending limit; a user can hold up to 20 active keys.
- Send Authorization: Bearer <LUMV_API_KEY> on every protected request, including file downloads. /v1 ignores cookies.
- Read the key from a secret store or the LUMV_API_KEY environment variable. Never write it into code, URLs,
repositories, messages or logs, and never send it to any host other than lumv.app.
- Public without a key: GET /v1/opencode/catalog, GET /v1/generation-models, GET /v1/generation-models/:id, /llms.txt, /llms-full.txt and the
/docs/api pages. Every other /v1 route requires the key, including GET /v1/models.
- The user sees every API request and its cost at https://lumv.app/account/api/usage.
## Endpoints
| Method | Path | Purpose |
| --- | --- | --- |
| GET | /v1/generation-models | Public list of enabled generation models: fields, scenarios, examples |
| GET | /v1/generation-models/:id | One generation model contract (404 model_not_found if disabled or unknown; a disabled version names its replacement in error.replacement) |
| POST | /v1/generations/estimate | Free price quote for a request body; nothing is charged or created |
| POST | /v1/generations | Start an asynchronous generation: 202 { generation } |
| GET | /v1/generations/:id | Status and results of your own generation |
| GET, HEAD | /v1/generations/:id/assets/:asset | Download a result file (Range; ?download=1 for an attachment) |
| POST | /v1/uploads | Create an upload session for a new input file |
| PUT | /v1/uploads/:id/content | Send the file bytes with X-Upload-Token |
| POST | /v1/uploads/:id/complete | Finish the upload and start validation |
| DELETE | /v1/uploads/:id | Cancel an unfinished upload |
| GET | /v1/assets/:id | State of an owned asset |
| GET, HEAD | /v1/assets/:id/content | Content of an owned asset (Range; ?role=thumbnail for image previews) |
| GET | /v1/projects | Project folders you can store generations in (projectId) |
| GET | /v1/models, /v1/models/:id | OpenAI-compatible list of text models |
| GET | /v1/opencode/catalog | Public live OpenCode chat catalog; no credentials or inference |
| GET | /v1/opencode/config | Same OpenCode catalog with personal-key validation for the Windows installer |
| POST | /v1/chat/completions | OpenAI Chat Completions for text models |
| POST | /v1/responses | OpenAI Responses for text models |
| GET, DELETE | /v1/responses/:id | Read or delete a stored response |
| GET | /v1/responses/:id/input_items | Input items of a stored response |
## Choosing a generation model
- Read GET /v1/generation-models (or the live catalog at the end of /llms-full.txt) before a task. Never invent model
IDs, field names or option values.
- A model has id (send it as "model"), name, description, category, endpoint ("/v1/generations"), basePriceCents
(indicative starting price), fields and scenarios. name, description and field labels are UI text and may be Russian;
always use the machine names.
- Field keys: name, label, description, type, required, defaultValue, options [{ value, label }], minimum, maximum,
step, maximumLength, accept, multiple, maximumItems, imageLimits, customDimensions, requires, visibleWhen { field,
equals }, withFiles { files, options, reason }, valueType, routingOnly, advanced, scenarios.
- Generation models are called only through POST /v1/generations, never through /chat/completions, /responses or
/images/generations. Text models from GET /v1/models are called only through the OpenAI-compatible endpoints.
## Request body
```json
{
"model": "MODEL_ID_FROM_CATALOG",
"values": { "prompt": "A red fox in fresh snow, golden hour" },
"inputAssets": [{ "fieldName": "FILE_FIELD_NAME", "assetId": "READY_ASSET_ID", "position": 0 }],
"projectId": "OPTIONAL_PROJECT_ID"
}
```
- The accepted top-level fields are model, values, inputAssets, projectId, expectedCostCents and maxCostCents. Any other key returns 400.
- values contains only field names of that model; unknown names, null and wrong JSON types return 400.
- Types: text, textarea and dimensions are JSON strings (dimensions such as "1024x1024" or an option value); number is
a JSON number; boolean is true or false; select is one of options[].value as a string, or as a JSON number when
valueType is "number"; json is a JSON object or array, or a string containing JSON. Omitted fields use defaultValue.
- File fields (type "file") never go into values. Pass them in inputAssets: fieldName is the file field, assetId is an
owned asset with status "ready", position is a 0-based index (0..maximumItems-1 for multiple fields). At most 100
references per request. URLs and base64 data are rejected.
- requires: the field may be sent only together with the named field; a file attached without its required file (an
end frame without a start frame) returns 422 instead of being ignored. visibleWhen: the field applies only while
another field equals the given value. withFiles: while any of the listed file fields is attached, only these options
are allowed (Seedance 2.5 frames: aspect_ratio "auto"); an omitted value is set automatically, another explicit
value returns 422 INVALID_OPTION_WITH_FILES. required, maximumLength, minimum, maximum, step, options and maximumItems are enforced;
contract violations return 422 with code invalid_model_input.
- customDimensions on a dimensions field: besides options[].value it accepts any "WxH" string whose sides are
multiples of multipleOf, at most maximumSide px, with minimumPixels..maximumPixels pixels and an aspect ratio up to
maximumAspectRatio:1 (for example "1600x896"); it is priced by area, other sizes return 422.
- imageLimits on an image field: minimumSide/maximumSide (px), maximumMegapixels and maximumBytes apply to each
image; upscalers add fixedScale, scaleField (the field holding the factor) or targetMegapixels (fixed result area,
aspect kept), optionally outputMultiple (result sides rounded up), and the result must stay within 25 MP and
8192 px per side. Sizes come from the asset; violations return 422. Background removal and upscale
models (category image, no prompt) bill per image or per output megapixel: use the estimate.
- Vidu Q4 always requires an owned image: video_mode image uses image_urls (one first frame); reference uses
reference_image_urls (1-12 images) and a non-empty prompt. Duration is an integer 3-16 seconds. aspect_ratio and
generate_audio apply only to reference mode; reference audio is currently unavailable.
- Gemini 3.8 Flash/Flash Lite TTS accept speech_mode single (text, voice) or dialogue (speakers, turns JSON).
Dialogue requires exactly two distinct speaker_id values and every turn must reference one. Omit text/voice in
dialogue mode. See field descriptions for JSON examples. Only transcripts and style instructions are billed;
speaker identifiers and JSON syntax are excluded. Total content including instructions is limited locally to
8192 UTF-8 bytes, conservatively below the provider's 8192-token ceiling.
## Scenarios
A model can have several scenarios. The server picks one from your request: scenarios are checked in the listed order
and the first matching condition wins; the scenario without a condition is the fallback. Conditions: file_present (a
file is attached to that field), truthy (the field is true, "true", "on" or a positive number), equals (the field equals
value exactly). A field with a scenarios list exists only in those scenarios, and its required flag applies only there.
Scenario limits override a field's minimum and maximum. Every scenario has a ready "example" request in the JSON contract.
## Estimate
POST /v1/generations/estimate takes the same body you will start (projectId is ignored here):
```json
{
"model": "MODEL_ID",
"costCents": 1500,
"currency": "RUB",
"charged": false,
"billing": { "wallet": "personal", "unlimited": false, "chargeCents": 1500, "keyBinding": "personal" }
}
```
- costCents is the catalog price of this exact request in kopecks (1500 = 15 credits). The optional fallbackCostCents
is the GPT Image baseline charge for other providers if OpenAI and Poyo Fixed both fail. It appears only on a discounted quote for a prepaid wallet.
- billing.wallet is "personal" or "team". Team billing also provides teamName. billing.chargeCents is the ordinary debit,
or 0 for an unlimited team. If present, billing.providerEstimateUsdMicros is the expected provider cost in millionths of a US dollar for an unlimited team.
billing.keyBinding is "personal", "team" or "account" (follows the wallet selected in the web app).
- The estimate validates values and inputAssets, and checks GPT Image connections for unlimited team USD estimates.
The wallet balance, project access and current tariff are checked at start. Prices can change between estimate and start.
- Before paid runs, agree on the total budget and the number of runs with the user. A successful test of one item is
not permission to run ten. Treat the key's monthly limit as a hard cap.
## Start and poll
- POST /v1/generations reserves the price from the wallet and returns HTTP 202, Retry-After: 3 and { "generation" }.
- For an exact debit, pass expectedCostCents equal to billing.chargeCents from the estimate. A price change returns 409
before charging. Pass only one of expectedCostCents and maxCostCents. An unlimited team has a zero debit.
- To authorize a GPT Image fallback at the baseline charge, send maxCostCents equal to fallbackCostCents from the estimate.
Start reserves that baseline amount. A successful discounted route refunds the difference to the same wallet.
Omit maxCostCents to keep the discounted price and its eligible routes. A current charge above the supplied cap returns 409.
- GET /v1/generations/:id returns { "generation" }. status: uploading, queued, processing (keep polling every 3-5
seconds, back off on temporary errors), completed (results ready) or failed (read error; the reserve is returned
automatically and refunded becomes 1).
- After a client timeout, repeat the same body with the original Idempotency-Key or resume polling with the saved generation.id.
For a failed job, read its error and check the budget before retrying. Other users' generations return 404.
- Generation fields: id, object ("generation"), status, error, createdAt and updatedAt (Unix ms), modelId (catalog id),
modelName, category, scenarioName, parameters (display summary), prompt (main text instruction or null),
reuseValues (non-file values for repeating the request), costCents (reserve while running, final price in kopecks after success, 0 for unlimited teams),
refunded, billingMode ("personal", "team" or "team_unlimited"), usageUsdMicros (provider cost in micro-USD for
team_unlimited, otherwise null), projectId, projectName, assets, modelFormats, inputAssets, previewUrl, viewerUrl,
viewerFormat, modelUrl, downloadUrl and textOutput.
## Results and downloads
- assets[]: id, url, downloadUrl, contentType, fileName, fileSize, mediaAssetId. url and downloadUrl are relative
(/v1/generations/:id/assets/:asset, downloadUrl adds ?download=1). Prefix https://lumv.app and send the same Bearer
header. GET, HEAD and Range requests are supported.
- previewUrl is the main preview; viewerUrl, modelUrl and downloadUrl point to the main 3D file (viewerFormat "gltf" or
"fbx"); textOutput holds text results; inputAssets[] lists the files used as inputs.
- modelFormats[] (3D results only): format ("glb", "gltf", "fbx", "obj", "usdz" or "stl"), origin ("original" from the
provider or "converted" by lumv), status ("ready", "processing" or "failed"), downloadUrl, fileName, fileSize. The
original GLB is ready with the generation; FBX (textures embedded) and OBJ (ZIP with OBJ, MTL and textures) are
converted in the background, usually within a minute: keep polling GET /v1/generations/:id while a format is
"processing", then download /v1/generations/:id/exports/:format with the same Bearer header. Copies that were not
downloaded for a while are deleted and show "processing" again; reading the generation by id or requesting the
export URL (404 until ready) recreates them.
- Never hand these URLs to a model or a third party; reuse results by mediaAssetId instead.
## Chaining results
mediaAssetId is the owned library asset of a result. It can be null briefly while the result is being saved: poll the
generation until it appears, then GET /v1/assets/:mediaAssetId until asset.status is "ready", and pass it as
inputAssets[].assetId to the next model. Owned images, videos and audio can be reused when the field's accept list
allows their type; so can the main model file of a 3D result. If an asset does not become ready in a reasonable
time, report it and keep the generation id.
Example task "10 images -> 10 3D models":
1. Pick an image model and a 3D model with an image file field from the catalog.
2. Fix parameters and the budget of the whole chain; estimate each step before starting it.
3. Keep a manifest for the 10 pairs: prompt, idempotency keys, generation IDs, asset IDs, cost, state. Save it after
every step so the run can resume after an interruption.
4. Generate the image of a pair; wait for completed and a ready image asset.
5. Pass that assetId to the 3D model through inputAssets. For Tripo, for example, choose generation_mode h31_image,
p2_image or p1_image and fieldName image_url (h31_multiview takes views of one object: front_image_url and
left_image_url, then optional back_image_url and right_image_url); take the exact limits from the current schema.
Tripo face_limit also depends on the mesh: H3.1 takes up to 150000 with quad true, 1500000 for triangles with
geometry_quality standard and 2000000 with detailed; P2 up to 50000 (25000 with quad); P1 up to 20000. Omit it to
get the mode default within that cap; a larger explicit value is refused with 422 before any charge.
6. Wait for the completed 3D model, download it and mark the pair done.
7. Continue with the other pairs. Keep at most 4 unfinished requests per key; sequential runs are simplest.
3D post-processing: model-tripo-remesh (retopology: quad, face_limit 500-20000 or 500-10000 with quad, bake,
part_names) and model-tripo-segment (parts; the result lists partNames) take one model in fieldName mesh_url. Pass the
mediaAssetId of the model file in a finished 3D result (it waits for "ready" like images) or upload GLB, OBJ, FBX or
STL with profile reference_model. quad returns FBX. To keep parts while remeshing, segment first, then remesh the
segmented model with part_names set to the partNames of that result.
## Uploading new input files
1. POST /v1/uploads with { "profile": "reference_image", "fileName": "input.png", "contentType": "image/png",
"size": BYTES } and an Idempotency-Key header (required, 8-128 characters from A-Z a-z 0-9 . _ : -). The same key and
declaration return the same session. Response 201 (200 on replay): { "upload": { id, assetId, state, uploadUrl,
leaseToken, maximumBytes, expiresAt } }.
2. PUT https://lumv.app + uploadUrl with the raw bytes and the headers Authorization, Content-Type and
X-Upload-Token: <leaseToken>. Never send more than maximumBytes.
3. POST /v1/uploads/:id/complete returns 202 { assetId, status: "pending" }.
4. GET /v1/assets/:assetId until asset.status is "ready" ("pending" and "validating" mean wait; "rejected" means stop
and report).
- Profiles for generation inputs: reference_image (JPEG, PNG or WebP up to 10 MiB; GIF, TIFF, AVIF and HEIC are
converted to PNG or JPEG while they are checked), reference_video (MP4 strictly
below 50,000,000 bytes and 15 seconds, validated before FLUX 3 editing), reference_audio (MP3, WAV, M4A or FLAC
up to 25 MiB and 1 hour; the measured duration prices per-second audio models and is checked against the model
limit), reference_model (GLB, OBJ, FBX or STL up to 50 MiB; the format is read from the bytes and GLB is parsed in
full; for 3D model fields such as mesh_url) and image_mask (PNG up to 10 MiB, same size as the source image; for
mask fields). chat_pdf, chat_document (DOCX, DOC, ODT, RTF, XLSX, ODS, PPTX, ODP) and chat_text are web chat
attachments read as extracted text; the text API accepts text content only.
- Upload sessions expire after 1 hour; DELETE /v1/uploads/:id cancels an unfinished one. Account quotas (by default
2 active upload sessions, 10 files awaiting validation, 250 MiB per day, 1 GiB of storage) return 429 when exceeded.
## Projects
projectId (POST /v1/generations only) stores the result in a project folder of the web workspace: your own project,
or a team-shared project where you have contribute access. A view-only project returns 403; a missing or invisible one
returns 404. GET /v1/projects lists the folders you can store results in:
{ "object": "list", "data": [{ "id", "object": "project", "name", "color", "team" (team name or null), "owned" }] }.
The id is also in the project page URL (https://lumv.app/projects/<id>). The generation then reports projectId
and projectName. projectId is part of the idempotency fingerprint. Text endpoints do not accept projectId.
## Wallets and billing
- Every API key is bound to a wallet when it is created (the user can change it later in /account/api/keys): the
personal balance, one team the user belongs to, or "account" (follow the wallet selected in the web app's account
settings or header switcher at request time; keys created before key binding use this mode). The estimate's billing
block shows which wallet will pay and keyBinding shows the key's mode.
- A key bound to a team the user has left, or to an archived team, is never silently switched to another wallet:
estimates and new requests return 403 with code wallet_unavailable until the user picks another wallet.
- Personal and prepaid team wallets: the price is reserved at start; refunds and adjustments return to the same wallet.
Insufficient funds return 402 (for a team wallet the message names the team).
- Unlimited teams: nothing is debited. costCents and billing.chargeCents are 0, billingMode is "team_unlimited", and
usageUsdMicros or providerEstimateUsdMicros report the provider cost (1 USD = 1,000,000 micros).
- A team that uses its own provider keys reaches only the models those providers serve; other models fail at start
with 503 (no suitable connection for the team). Estimates do not detect this.
- The key's monthly limit counts reserves of the current UTC calendar month (failed requests excluded); a request that
would exceed it returns 402.
- Text models are billed by tokens: the start reserves the maximum (context, max tokens and the reasoning reserve);
the final charge follows the reported usage and never exceeds the reserve.
## Idempotency and retries
- Send a unique Idempotency-Key header (1-128 printable ASCII characters, no spaces) with every logical
POST /v1/generations, /v1/chat/completions and /v1/responses request. Keys are scoped to the API key.
- The same key with the same body (including projectId) returns the original job instead of charging again; the same
key with a different body returns 409.
- Save the key and the body before sending. After a timeout or a network error, retry with the same key and body.
Never change the key while the outcome is unknown, or the request may run and be charged twice.
- Retry only 429, 503, 504 and network errors, a limited number of times with exponential backoff, and honor
Retry-After when present. Never retry in an endless loop.
## Limits
- 4 unfinished requests per key, generations and text requests combined; more return 429 until one finishes.
- JSON bodies up to 6,000,000 bytes (the gateway rejects anything over 8 MiB); larger bodies return 413.
- inputAssets: up to 100 references per request, and each field's maximumItems.
- Gateway rate limit of about 100 requests per second per IP address (429).
- Upload content: the profile maximum (10 MiB for images); the gateway accepts at most 20 MiB per PUT.
- Text requests: 1-1000 messages, up to 200,000 characters per text part, up to 32 tools, max tokens from 1 to the
model's output limit (Gemini 4 Argon: 1,000,000; default 4096). A non-streaming request waits up to 14 minutes (2 hours when max
tokens exceed 128,000) and then returns 504; repeat it with the same Idempotency-Key to get the same result.
## Errors
Errors look like { "error": { "message", "type", "param": null, "code" } }. message is human-readable and usually in
Russian, so branch on the HTTP status and code. type is "authentication_error" for 401 and "invalid_request_error"
otherwise; code is null, invalid_request_error or one of model_not_found, not_found, response_not_found, invalid_model_input,
invalid_project, wallet_unavailable, invalid_api_key, insufficient_scope, rate_limit_exceeded. The gateway can answer 413 or 429 without a JSON body.
A 404 model_not_found for a disabled version of a model family also has "replacement": the enabled model id that
replaced it (for example a newer GPT Image version). The API never switches models itself: read the replacement's
schema and estimate its price before sending the request to it.
| Status | Meaning | What to do |
| --- | --- | --- |
| 400 | Invalid JSON, unknown top-level key or field, wrong value type, file in values, bad Idempotency-Key, unsupported OpenAI parameter | Fix the request; do not retry unchanged |
| 401 | Missing, revoked or expired key | Stop and ask the user for a valid key |
| 402 | Wallet balance too low or the key's monthly limit reached | Stop and tell the user |
| 403 | The key lacks the scope (insufficient_scope), you are not a team admin, the project does not accept new results from you (invalid_project), or the key's team wallet is no longer available (wallet_unavailable) | Ask the user to widen the key, drop projectId, or choose another wallet for the key |
| 404 | Model, generation, asset, upload, project or stored response is missing or not yours | Check the IDs |
| 408 | Upload body was not received in time | Repeat the PUT |
| 409 | Idempotency-Key reused with a different body | Resend the original body, or use a new key for a new task |
| 413 | Body or file too large | Make it smaller |
| 415 | Unsupported upload profile or file format | Use a supported profile and type |
| 416 | Invalid Range header | Fix the range |
| 422 | values break the model contract (REQUIRED, INVALID_*, OUT_OF_RANGE, TEXT_TOO_LONG, TOO_MANY_FILES, REQUIRES_FIELD) | Fix values against the schema |
| 429 | 4 unfinished requests on the key, gateway rate limit or upload quota | Wait for running jobs, then back off |
| 502 | The text model failed to answer (the reserve is returned) | Retry later with a new Idempotency-Key |
| 503 | Temporary failure, no available provider (also: no suitable connection for the team), uploads disabled | Limited retries with the same key |
| 504 | A text request timed out while waiting | Retry with the same Idempotency-Key |
## OpenAI-compatible chat API
Base URL https://lumv.app/v1, the lumv key as the API key, model IDs from GET /v1/models (or the text models at the end
of /llms-full.txt). GET /v1/models returns { "object": "list", "data": [{ "id", "object": "model", "created": 0,
"owned_by": "lumv", "capabilities": { "input": ["text", "image"], "output": ["text"], "tools": true } }] }.
The input capabilities list includes image only for vision models. Audio and file inputs, response_format and built-in tools are not supported.
### POST /v1/chat/completions
- Accepted: model, messages (roles system, developer, user, assistant, tool; content is a string or an array of
{ "type": "text", "text" } parts; user messages also accept image_url parts), max_tokens or max_completion_tokens, temperature (0-2), top_p (above 0, up to 1),
tools, tool_choice ("none", "auto", "required" or { "type": "function", "function": { "name" } }),
parallel_tool_calls, reasoning_effort, stream, stream_options.include_usage and n (1 only). response_format, audio
and modalities return 400; other OpenAI parameters are ignored.
- Response: chat.completion with choices[0].message (content and/or tool_calls), finish_reason ("stop", "length" or
"tool_calls") and usage (prompt_tokens, completion_tokens, total_tokens, prompt_tokens_details.cached_tokens).
- stream: true returns text/event-stream with chat.completion.chunk objects, ": keep-alive" comments every 10 seconds,
tool_calls in one chunk at the end, a final usage chunk with empty choices when include_usage is true, errors as
data: { "error" } and the terminator data: [DONE].
### POST /v1/responses
- Accepted keys: model, input (a string, or items: messages with roles system, developer, user or assistant and string
or input_text/output_text content, plus input_image in user messages; function_call; function_call_output; reasoning), instructions,
previous_response_id, max_output_tokens, stream, store (default true), tools, tool_choice, temperature, top_p,
parallel_tool_calls, reasoning, text ({ "format": { "type": "text" } } and verbosity low, medium or high), metadata
(up to 16 string pairs; keys up to 64 and values up to 512 characters), background (false only), truncation
("disabled" only), stream_options ({ "include_obfuscation": false } only), prompt_cache_key and include
(["reasoning.encrypted_content"] only). Any other key returns 400.
- Response: object "response" with status ("completed", "failed" or "in_progress"), output items (message with
output_text, function_call with call_id, name and arguments, reasoning with summary_text) and usage (input_tokens,
output_tokens, input_tokens_details.cached_tokens, output_tokens_details.reasoning_tokens).
- Stored responses (store true): GET /v1/responses/:id, GET /v1/responses/:id/input_items (a list, has_more false) and
DELETE /v1/responses/:id ({ "id", "object": "response.deleted", "deleted": true }). previous_response_id continues a
completed stored response; earlier system and developer messages are not carried over, so send instructions again.
- stream: true emits events with type and sequence_number: response.created, response.in_progress,
response.output_item.added, response.content_part.added, response.output_text.delta, response.output_text.done,
response.content_part.done, response.output_item.done, response.function_call_arguments.delta,
response.function_call_arguments.done, response.completed, response.failed and error.
### Image inputs
- Select a model whose GET /v1/models capabilities.input includes "image". Unsupported models return 400
unsupported_image_input before reserving funds. OpenCode config and the live catalog publish the same capability.
- Chat Completions user content: [{ "type": "text", "text": "Describe this screenshot" },
{ "type": "image_url", "image_url": { "url": "https://example.com/screenshot.png", "detail": "auto" } }].
- Responses user content: [{ "type": "input_text", "text": "Describe this screenshot" },
{ "type": "input_image", "image_url": "https://example.com/screenshot.png", "detail": "auto" }].
- URLs must be public HTTPS URLs without credentials, or data:image/png;base64,... (also image/jpeg and image/webp).
Inline images are limited to 4 MiB decoded, up to 5 images per user message; the complete JSON body stays limited to
6,000,000 bytes. detail is optional: auto, low or high. Image-only user messages are allowed.
- lumv forwards URLs to the provider without fetching them. Local paths, file IDs, images in system/assistant/tool
messages, SVG, GIF and audio are unsupported. Send tool screenshots as a following user message.
- The reserve includes 8192 input tokens per image instead of charging base64 characters as text; final usage comes
from the provider with the existing refund and reserve cap. Images persist in stored Responses continuations.
- Existing OpenCode installations must refresh the lumv plugin using the installer and run opencode reload.
### Function tools
Declare up to 32 tools of type "function" (name matching [a-zA-Z0-9_-]{1,64}, optional description, JSON Schema
parameters and strict). Chat Completions nests them as { "type": "function", "function": { ... } }; Responses uses the
flat { "type": "function", "name", ... } form. When the model calls a tool, run it yourself: send back the assistant
message with tool_calls and then { "role": "tool", "tool_call_id", "content" } messages, or function_call_output items
with call_id in Responses. lumv never executes your tools.
### Reasoning effort
reasoning_effort (Chat Completions) or reasoning.effort (Responses) accepts none, minimal, low, medium, high, xhigh, max
or ultra, but only the values a model lists (reasoning_effort in the text model catalog); other values return 400.
Higher effort increases the reserved price. Responses also accept reasoning.summary ("auto", "concise" or "detailed";
the alias generate_summary must match it); summaries appear as reasoning output items only when the provider returns
them. DeepSeek models combined with function tools accept only effort none or no effort.
Claude Haiku 5.5 supports low, medium, high, xhigh and max (default medium), a 1,000,000-token context and
128,000 output tokens. lumv maps both API formats to native Messages so effort reaches the provider. Sampling
parameters are omitted. Forced function tools disable thinking and accept only low, medium or high effort;
xhigh/max with forced tools are rejected. Automatic tools retain adaptive thinking.
## Key permissions
Every key carries scopes in the form resource:level, and write always includes read. Resources: models (catalog),
chat (read: stored Responses; write: Chat Completions and Responses), generations (read: status, history, estimate;
write: start paid jobs), files (read: library files; write: uploads), projects, account, team (read: teams, wallet,
roster, usage, ledger, provider balances; write: team settings) and team_members (read: invitations and join requests;
write: invite, approve, change roles, remove). Keys created before scopes keep every personal scope and no team scope.
Team scopes can be restricted to one team; other teams then answer 404. A valid key without the needed scope gets
403 with code insufficient_scope; an invalid key gets 401 with code invalid_api_key. GET /v1/me returns the user,
balances, the paying wallet, the key's scopes, teamAccessId, monthly limit and spend of the current month.
Generation history: GET /v1/generations?limit=20&status=completed&before=CURSOR (nextCursor pages back).
## Team management API
Scopes never raise the role: changes need the key owner to be an admin of that team at request time.
- GET /v1/teams, GET /v1/teams/:id: role, wallet { mode prepaid|unlimited, balanceCents, topupPolicy }, member count,
30-day spend and which own provider keys are configured. PATCH /v1/teams/:id { name, topupPolicy } (team:write).
- GET /v1/teams/:id/members; PATCH /v1/teams/:id/members/:userId { role: admin|member }; DELETE removes a member
(the last admin cannot be demoted or removed; the key owner cannot remove themselves through the API).
- POST /v1/teams/:id/invitations { email, role } sends a personal invitation and returns { id, email, role, url,
expiresAt, emailSent }. Only the account with that verified email can accept it, immediately, without a join request.
A new user can register with that email and the invitation applies; teams with managed accounts (below) skip it.
{ type: "link" } rotates the shared link, whose join requests an admin approves: GET /v1/teams/:id/join-requests,
POST /v1/teams/:id/join-requests/:requestId { decision: approve|reject }. GET and DELETE
/v1/teams/:id/invitations[/:invitationId] list and revoke invitations.
- GET /v1/teams/:id/usage?group_by=member|model|key|day&days=30 (or from/to, ISO dates, up to 366 days): requests,
completed, failed, spentCents (net of refunds) and providerCostUsdMicros per group plus totals. member and key
breakdowns are admin-only. GET /v1/teams/:id/ledger?limit=50&offset=0 lists wallet movements.
- GET /v1/teams/:id/provider-balances?fresh=1 (admin): balances of the team's own provider keys.
## Team-managed accounts (fully automated onboarding)
Available when lumv support enabled "managed accounts" for the team (GET /v1/teams/:id → managedAccounts: true);
otherwise these calls answer 403. All need team_members:write (listing keys: team_members:read) and the admin role.
- POST /v1/teams/:id/members { email, role?, password?, apiKey?, loginLink? }. A free email gets a ready account
right away: verified email, no invitation email, no starter bonus, already a member with the team wallet selected
→ 201 { object: "team.member", status: "created", userId, email, role, joinedAt, managed: true, apiKey, loginLink }.
apiKey ({} or { name, scopes, monthlyLimitCents, expiresAt }) issues a key in the same transaction; loginLink
({ expiresInMinutes }, default 60, max 10080) returns { url, expiresAt }. An email already in the team → 200
status "existing_member" (no new key; loginLink still works for a managed member). An email that belongs to another
account is never taken over → 202 status "invited" with a personal invitation.
- POST /v1/teams/:id/members/:userId/api-keys { name?, scopes?, monthlyLimitCents?, expiresAt? } → 201 { id, name,
prefix, key (secret, shown once), scopes, wallet { mode: "team", teamId }, setup }. setup.claudeCode.command is a
ready "claude mcp add --transport http --scope user lumv <mcpUrl> --header 'Authorization: Bearer <key>'" line;
setup.claudeCode.mcpServers is the same server as JSON for .mcp.json or claude mcp add-json; setup.env has
LUMV_API_KEY. Default scopes are the personal ones (models, chat, generations, files, projects, account). The key
always charges the team wallet; the member owns it and sees it marked "from the team" in the dashboard.
- GET /v1/teams/:id/members/:userId/api-keys lists keys this team issued (no secrets);
DELETE /v1/teams/:id/members/:userId/api-keys/:keyId revokes one.
- POST /v1/teams/:id/members/:userId/login-links { expiresInMinutes? } → 201 { url, expiresAt }: a one-time
https://lumv.app/login/link/<token> page; the member presses the sign-in button and is signed in without password or email.
Deliver it through the team's own channel (portal, chat). Members can set a password later in account settings.
Keys and login links work only for accounts this team created and while they stay in the team: leaving or removal
revokes the issued keys and unused links and ends the team's control over the account.
## MCP server
https://lumv.app/v1/mcp is a remote Model Context Protocol server (Streamable HTTP, stateless JSON responses,
protocol up to 2025-11-25) authorized with the same Bearer key, or by OAuth for web connectors such as Claude.ai and
ChatGPT (RFC 9728 metadata at /.well-known/oauth-protected-resource/v1/mcp, Client ID Metadata Documents or dynamic
registration, PKCE S256, resource indicator; the token works only at /v1/mcp). tools/list contains only the tools the
key's or grant's scopes allow: get_account, list_generation_models, get_generation_model, list_chat_models, list_projects,
estimate_generation, create_generation, get_generation, list_generations, chat, the file tools create_upload, get_file,
list_files and the team tools list_teams, get_team,
list_team_members, get_team_usage, get_team_ledger, get_team_provider_balances, list_team_invitations,
list_team_join_requests, list_member_keys, update_team, invite_team_member, revoke_team_invitation,
decide_team_join_request, set_team_member_role, remove_team_member and the managed-account tools create_team_member,
issue_member_key, revoke_member_key and create_member_login_link. create_generation and get_generation wait at most 50 seconds and return
the current status; keep polling get_generation with the id. Up to 300 MCP messages per minute per key.
Files through MCP need no API key in the shell: create_upload { fileName, mask? } returns a one-time signed PUT URL
(30 minutes) with a ready command such as curl -sS -T photo.png "<uploadUrl>"; its JSON answer has assetId, get_file
waits until status is ready, then pass { fieldName, assetId, position } in inputAssets (estimate and create also wait
up to 20 seconds for a fresh upload; a file still being validated answers 409, a rejected one 422). A completed generation lists
files[] with downloadUrl (signed, works without the key for one hour: curl -L -o name "<downloadUrl>") and the
result assetId, which the next generation can take as input. list_files finds earlier uploads and results.
update_team also sets lowBalanceAlertUsd: team admins get an email when the prepaid wallet or an own provider key
drops below it (default $10, null turns it off).