VLM – Requests
This page is part of the Custom Vision Language Models (VLM) API reference. See the overview for task modes, key concepts, the end-to-end workflow and the list of all endpoints.
Request Endpoints
Once a task has a trained, deployed model, you run inference by submitting an async request. Requests are processed in the background by a pool of workers: you submit a request, receive an id immediately, and then poll for the result (or receive it via a webhook).
The request body follows the OpenAI chat-completions messages format, so you can send one or more images together with optional prompt instructions.
The shape of the response depends on the task mode and the trained model:
- instruction: the rendered result template, parsed into the dataset's
result_formatwhen possible (e.g. a JSON object with your variables) - agentic: the assistant's turn, i.e. thoughts, tool calls with arguments and/or the final answer, so your application can execute the tools and continue the conversation
- retrieval: the embedding vector(s) of the submitted images and text, ready to be stored in a vector index
The API stores request and response as opaque JSON; it does not validate them per mode.
Request Lifecycle
A request moves through a series of statuses. Submit returns CREATED; the result is ready once the status reaches DONE.
| Status | Description |
|---|---|
CREATED | Submitted and waiting in the queue to be picked up by a worker. |
PENDING | Reserved by a worker, about to be processed. |
PROCESSING | A worker has claimed the request and the model is generating the response. |
RETRY | A transient failure occurred (e.g. rate limit or GPU OOM); the request will be retried automatically. |
DONE | Completed successfully — the response field holds the model output. |
FAILED | Processing failed after exhausting all retries. |
API_LIMIT_EXCEEDED | Rate limit hit or insufficient credits. |
NOT_SUPPORTED | The request or the model is not supported. |
Completed requests are retained for a limited time (2 weeks by default) and then automatically cleaned up. Download or store the response if you need it long-term.
Prompt Resolution
You usually do not need to send any prompt text — the model uses the system and user prompts configured on the task. When you do want to override them for a single request, the prompt is resolved in this order of priority:
system_prompt_id/user_prompt_id— a reference to a saved prompt. Highest priority.- Inline text in
messages— asystemmessage and/or ausertext part written directly in the request. - Task default — the prompt referenced by the task. Used when neither of the above is provided.
Submit Request
Submit a new async inference request for a trained task. Returns the created request immediately with status CREATED — poll Get Request Status or Get Request for the result.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
task_id- Type
- string
- Description
UUID of the VLM task to run inference on. The task must have a trained model.
- Name
request- Type
- object
- Description
The inference payload in OpenAI chat-completions format. Contains a
messagesarray with the image(s) and any inline prompt text. Provide between 1 and 10 images per request.
Optional attributes
- Name
version- Type
- integer
- Description
Model version to use. Defaults to the task's current
production_version.
- Name
system_prompt_id- Type
- string
- Description
UUID of a saved prompt to use as the system prompt for this request. Takes priority over the task's system prompt and any inline
systemmessage.
- Name
user_prompt_id- Type
- string
- Description
UUID of a saved prompt to use as the user prompt (instruction) for this request. Takes priority over the task's user prompt and any inline
usertext.
- Name
webhook- Type
- object
- Description
Callback target for the result, e.g.
{"url": "https://...", "headers": {...}}. When set, the response is POSTed to this URL once the request isDONE.
- Name
priority- Type
- integer
- Description
Queue priority (higher is processed first). Defaults to your account priority.
Returns
- Name
id- Type
- string
- Description
UUID of the created request. Use it to poll for the result.
- Name
status- Type
- string
- Description
Current status —
CREATEDright after submission.
- Name
task_id- Type
- string
- Description
UUID of the task the request was submitted to.
- Name
version- Type
- integer
- Description
Model version the request will be processed with.
- Name
created- Type
- string
- Description
Timestamp when the request was created (ISO 8601 format).
- Name
workspace- Type
- string
- Description
UUID of the workspace the request belongs to.
Request
curl -v -XPOST \
-H 'Authorization: Token __API_TOKEN__' \
-H 'Content-Type: application/json' \
-d '{
"task_id": "__TASK_ID__",
"request": {
"messages": [
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
]
}
]
}
}' \
https://api.ximilar.com/vlm/v2/request/
Response
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "CREATED",
"task_id": "dbb498ba-cf24-4400-9897-d5196444a880",
"version": 2,
"created": "2026-01-15T09:21:04.118273Z",
"workspace": "748e50e4-d081-4924-b9e7-f500aac6a71d"
}
Get Request Status
Get only the status of a request. This is a lightweight endpoint intended for polling — it does not return the (potentially large) request and response payloads.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
request_id- Type
- string
- Description
UUID of the request.
Returns
- Name
status- Type
- string
- Description
Current status of the request (see Request Lifecycle).
Request
curl -v -XGET \
-H 'Authorization: Token __API_TOKEN__' \
https://api.ximilar.com/vlm/v2/request/__REQUEST_ID__/status/
Response
{
"status": "DONE"
}
Get Request
Get the full detail of a request, including the original request payload and, once the request is DONE, the model response and token usage.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
request_id- Type
- string
- Description
UUID of the request.
Returns
- Name
id- Type
- string
- Description
UUID of the request.
- Name
status- Type
- string
- Description
Current status of the request.
- Name
task_id- Type
- string
- Description
UUID of the task.
- Name
version- Type
- integer
- Description
Model version used.
- Name
request- Type
- object
- Description
The original inference payload that was submitted.
- Name
response- Type
- object
- Description
The model output.
nulluntil the request isDONE(or an error object on failure).
- Name
usage- Type
- object
- Description
Token usage statistics (e.g.
prompt_tokens,completion_tokens,total_tokens,processing_time).nulluntil the request completes.
- Name
system_prompt_id- Type
- string
- Description
Saved system prompt override applied to this request, if any.
- Name
user_prompt_id- Type
- string
- Description
Saved user prompt override applied to this request, if any.
- Name
webhook- Type
- object
- Description
Webhook target the result is/was delivered to, if configured.
- Name
retry_count- Type
- integer
- Description
Number of times the request has been retried.
- Name
created- Type
- string
- Description
Timestamp when the request was created (ISO 8601 format).
- Name
started_at- Type
- string
- Description
Timestamp when a worker started processing the request.
- Name
completed_at- Type
- string
- Description
Timestamp when the request reached a terminal state.
- Name
workspace- Type
- string
- Description
UUID of the workspace the request belongs to.
Request
curl -v -XGET \
-H 'Authorization: Token __API_TOKEN__' \
https://api.ximilar.com/vlm/v2/request/__REQUEST_ID__/
Response
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "DONE",
"task_id": "dbb498ba-cf24-4400-9897-d5196444a880",
"version": 2,
"request": {
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this product and estimate its price."},
{"type": "image_url", "image_url": {"url": "https://example.com/front.jpg"}}
]
}
]
},
"response": {"description": "A wooden puzzle for kids.", "price": 8.99},
"usage": {
"prompt_tokens": 27,
"completion_tokens": 92,
"total_tokens": 359,
"processing_time": 3.33
},
"system_prompt_id": null,
"user_prompt_id": null,
"webhook": null,
"retry_count": 0,
"created": "2026-01-15T09:21:04.118273Z",
"started_at": "2026-01-15T09:21:06.402551Z",
"completed_at": "2026-01-15T09:21:09.731904Z",
"workspace": "748e50e4-d081-4924-b9e7-f500aac6a71d"
}
List Requests
List requests in your workspace. Returns paginated results with large payload fields omitted for performance.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
Optional attributes
- Name
workspace- Type
- string
- Description
Workspace UUID. Defaults to your default workspace.
- Name
status- Type
- string
- Description
Filter by status, e.g.
CREATED,PROCESSING,DONE,FAILED.
- Name
task_id- Type
- string
- Description
Filter by task UUID.
- Name
page_size- Type
- integer
- Description
Number of results per page.
Request
curl -v -XGET \
-H 'Authorization: Token __API_TOKEN__' \
'https://api.ximilar.com/vlm/v2/request/?status=DONE&task_id=__TASK_ID__'
Request History
List completed (DONE) requests, including their response and usage. Uses fast cursor-based pagination — follow the next cursor returned in the response to page through results.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
Optional attributes
- Name
task_id- Type
- string
- Description
Filter history by task UUID.
- Name
page_size- Type
- integer
- Description
Number of results per page (default 20, max 100).
- Name
cursor- Type
- string
- Description
Pagination cursor returned in a previous response.
Request
curl -v -XGET \
-H 'Authorization: Token __API_TOKEN__' \
'https://api.ximilar.com/vlm/v2/request/history/?task_id=__TASK_ID__&page_size=20'
Resubmit Request
Re-queue a request that finished in a terminal state (DONE, FAILED, API_LIMIT_EXCEEDED, or NOT_SUPPORTED). The status is reset to CREATED and the previous response, usage, and timing fields are cleared so the request is processed again.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
request_id- Type
- string
- Description
UUID of the request to resubmit.
Request
curl -v -XPOST \
-H 'Authorization: Token __API_TOKEN__' \
https://api.ximilar.com/vlm/v2/request/__REQUEST_ID__/resubmit/
Delete Request
Delete a request. A request that is currently PROCESSING cannot be deleted, and a DONE request can only be deleted after it has been billed.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
request_id- Type
- string
- Description
UUID of the request to delete.
Request
curl -v -XDELETE \
-H 'Authorization: Token __API_TOKEN__' \
https://api.ximilar.com/vlm/v2/request/__REQUEST_ID__/