Skip to main content

POST /inference

Submits automation tasks to an Optexity inference server for asynchronous execution.

Description

The inference endpoint is the primary way to submit automation tasks to an Optexity inference server. Tasks are enqueued and executed asynchronously in the background. The endpoint supports both local development and cloud production deployments.

Authentication

Local endpoint (http://localhost:9000/inference) does not require authentication and is free to use for development and testing.
Cloud endpoint (https://api.optexity.com/api/v1/inference) requires authentication with an API key in the request header. API keys can be found in the Optexity dashboard under the “API Keys” section. This requires a paid plan. Contact us at founders@optexity.com to get a paid plan.

Parameters

Headers

  • Content-Type string required Must be set to application/json
  • Authorization string required (cloud endpoint only) API key for authentication. Format: x-api-key YOUR_OPTEXITY_API_KEY Not required for local endpoint

Body Parameters

  • endpoint_name string required Name of the automation endpoint to execute. Must match a recording/automation configured in the Optexity control plane.
  • input_parameters dict[str, list[str]] required Input values for the automation. Keys are parameter names, values are lists of strings. Every parameter defined in the automation’s input_parameters should be provided here. If a parameter is given an empty list and it is used in an input text action, the action will be skipped.
  • secure_parameters dict[str, list[SecureParameter]] optional Secure parameters for the automation. Keys are parameter names, values are lists of secure parameters. Every parameter defined in the automation’s secure_parameters should be provided here. These are used to securely store sensitive information like passwords, API keys, and other secrets. Please refer to the Secure Parameters API Reference and One Password Integration documentation for more information.
  • unique_parameter_names list[str] optional Subset of keys from input_parameters that uniquely identify this task. Used for deduplication. Every name in this list must exist as a key in input_parameters.
  • priority integer optional Queue priority for this task within its login‑queue. Lower number runs first; negatives allowed; omit (or send null) to run last. Priority only reorders waiting tasks — a currently‑running task is never interrupted. Scope is per login‑queue and never affects other users or other portals.

Code Examples

Example with Secure Parameters

Response

Success Response (202 Accepted)

The task has been enqueued and will execute asynchronously. Local endpoint (http://localhost:9000/inference):
Cloud endpoint (https://api.optexity.com/api/v1/inference):
Response Fields:

Error Responses

400 Bad Request

Returned when request parameters are invalid.
Common causes:
  • unique_parameter_names contains a key that doesn’t exist in input_parameters
  • Parameter values are not lists of strings
  • Missing required endpoint_name or input_parameters fields

404 Not Found

Returned when the specified endpoint does not exist.
Common causes:
  • endpoint_name doesn’t match any configured automation
  • Endpoint has been deleted or is not accessible

401 Unauthorized

Returned when authentication fails (cloud endpoint only).
Common causes:
  • Missing Authorization header
  • Invalid API key format
  • Expired or revoked API key

500 Internal Server Error

Returned when an unexpected server error occurs.
Common causes:
  • Network connectivity issues with the control plane
  • Control plane service unavailable
  • Internal server configuration errors

How It Works

  1. The inference server receives the InferenceRequest
  2. It forwards the request to the Optexity control plane at api.optexity.com
  3. The control plane returns a serialized Task object containing the full workflow
  4. The task is enqueued locally for background execution
  5. A 202 Accepted response is returned immediately
  6. The browser automation executes asynchronously

Validation

The endpoint validates:
  1. All unique_parameter_names exist in input_parameters
  2. All parameter values are lists of strings
  3. The endpoint_name matches a valid automation

Configuration

The endpoint uses these settings from environment variables:
The control plane returns a Task object with this structure: