Path parameters

  • inference_idstring Required

    The unique identifier for the inference endpoint.

application/json

Body

  • inputstring | array[string] Required

    The text on which you want to perform the inference task. It can be a single string or an array.

    NOTE: Inference endpoints for the completion task type currently only support a single string as input.

Responses

  • 200 application/json
POST /_inference/completion/{inference_id}/_stream
curl \
 --request POST 'http://api.example.com/_inference/completion/{inference_id}/_stream' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '"{\n  \"input\": \"What is Elastic?\"\n}"'
Request example
Run `POST _inference/completion/openai-completion/_stream` to perform a completion on the example question with .
{
  "input": "What is Elastic?"
}