POST
/
api
/
v1
/
inference
/
Start a new inference task
curl --request POST \
  --url https://api.optexity.com/api/v1/inference/ \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "end_point": "<string>",
  "goal": "<string>",
  "params": {}
}'
{
  "success": true,
  "task_id": "<string>",
  "status": "started",
  "message": "<string>"
}

Start a New Inference Task

This endpoint allows you to start a new inference task with specified parameters and goals.

Request Headers

HeaderTypeRequiredDescription
x-api-keystringYesYour API key for authentication

Request Body

FieldTypeRequiredDescription
end_pointstringYesThe endpoint or service to call for inference
goalstringYesThe goal or objective for this inference task
paramsobjectNoAdditional parameters for the inference task

Example Request

curl -X POST /api/v1/inference/ \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "end_point": "https://api.example.com/process",
    "goal": "Analyze customer feedback sentiment",
    "params": {
      "model": "gpt-4",
      "temperature": 0.7,
      "max_tokens": 1000
    }
  }'

Example Response

{
  "success": true,
  "task_id": "task_987654321",
  "status": "started",
  "message": "Inference task started successfully"
}

Error Responses

400 Bad Request
{
  "error": "Missing required fields: end_point, goal"
}
401 Unauthorized
{
  "error": "Invalid API key"
}
500 Internal Server Error
{
  "error": "Failed to start inference task"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Response

200
application/json

Inference task started successfully

The response is of type object.