Inference Async
This endpoint allows you to process documents taking advantage of our AI engine documents processing capabilities in an asynchronous fashion.
Once you issue a request to this endpoint our system will promptly start processing the document; you do not have, however, to wait until the document is fully processed, the system will instead immediately respond with a unique resource ID referencing the document, that, along with the unique ID of the service, enables you to retrieve the result of the processing operation using the dedicated Get Inference Result endpoint.
Tip
Documents processed using this endpoint will also be available for you to consult, validate and correct in the myBiros Platform’s web interface.
In the following a description of expected request format is provided, along with a description of the endpoint’s response model.
Request
curl --location 'https://platform.mybiros.com/api/v1/inference/service/:service_id:/async-predict' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--form 'file=@"/path/to/file"'
Parameters
Headers Parameters
x-api-key
(required)-
Type:
string
A valid API key for the service.
Path Parameters
service_id
(required)-
Type:
string
Identifier of the service.
Body Parameters
The accepted body content-type
is multipart/form-data
with the following parameters specified as form fields:
file
(required)-
Type:
bytes
Bytes of the file to process.
Info
For further information on supported file types, see Limits & Constraints.
Responses
Successful Responses
The request was successful, and a JSON response is returned.
Status | Message | Description | Reference |
---|---|---|---|
200 | OK | the request has succeeded. | Success Response 200 |
Status 200 - OK
Schema: Inference Async Response
Key | Type | Description |
---|---|---|
job | string | unique ID of the processing job |
resource | string | unique ID of the response, it provides a reference to the uploaded document |
Error Responses
The request was unsuccessful, and a specific status code is returned to identify the error.
Status | Message | Description | Reference |
---|---|---|---|
401 | Unauthorized | the server has not been able to authenticate the request. | Response 401 |
403 | Forbidden | the service successfully authenticated the request but you are not allowed to perform the requested action. | Response 403 |
404 | Not Found | the server could not locate the requested resource. | Response 404 |
422 | Unprocessable Content | the server has not been able to process the content of the request. | Response 422 |
429 | Too Many Requests | the client has sent too many requests in a short period, exceeding the rate limit. Please try again later. | Response 429 |
500 | Internal Server Error | the server encountered an unexpected and unrecoverable error while processing the request. | Response 500 |
503 | Service Unavailable | the server could be under maintenance for an update. Will be back soon. | Response 503 |
Status 401 - Unauthorized
The current endpoint is protected and requires an API key to be accessed. If sufficient privileges are not present, the request will not be authorized.
Tip
Double-check that the API Key is correct, valid and set using the x-api-key
header
in the request. Also make sure that you are using the right API key for the service
you are requesting and that the service ID in it is correct and corresponds to the ID of
an existing service in your account.
Status 403 - Forbidden
The server has denied the request because the user is not allowed to perform the required action. This happens when the user has exceeded the allowed quota defined in their usage plan.
Tip
You can monitor service usage on the Platform's web interface.
Status 404 - Not Found
The service ID provided does not exist or could not be found. Please verify the ID and try again.
Status 422 - Unprocessable content
This status code indicates that the server successfully received and understood the request, but it cannot process it due to errors in the provided data. These errors may include missing fields, invalid formats, or values that do not meet the endpoint requirements.
Tip
Double-check your request's payload format and parameters
Status 429 - Too Many Requests
This status code is returned when the client has made too many requests in a given timeframe, exceeding the rate limits set by the server. It indicates that the client needs to slow down and retry after a specified cooldown period. Rate limits are typically enforced to protect the server from being overwhelmed and to ensure fair use of resources.
Status 500 - Internal Server Error
This status code indicates that the server encountered an unexpected error or condition that prevented it from completing the request. It is a generic error message when no more specific message is suitable. The client cannot resolve the issue.
Status 503 - Service Unavailable
This status code indicates that the server is currently unavailable, typically due to ongoing maintenance or temporary overloading. The server is unable to handle the request at the moment, but the issue is expected to be resolved shortly. This status code signals that the downtime is temporary, and the service will be restored once maintenance is complete.