POST
/
models
/
v2
/
{modelId}
curl --request POST \
  --url https://api.bytez.com/models/v2/{modelId} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "text": "<string>",
  "messages": [
    {
      "role": "system",
      "content": "<string>"
    }
  ],
  "url": "<string>",
  "base64": "<string>",
  "question": "<string>",
  "context": "<string>",
  "candidate_labels": [
    "<string>"
  ],
  "stream": true,
  "json": true,
  "params": {
    "min_length": 123,
    "max_length": 123,
    "temperature": 123
  }
}'
{
  "error": null,
  "output": "<string>"
}

Authorizations

Authorization
string
header
required

Set Authorization header to Key BYTEZ_KEY (e.g. 'Authorization': 'Key ABC123')

Path Parameters

modelId
string
required

The model you want to run (e.g., openai-community/gpt2).

Body

application/json
The required inputs vary by task. For text-based tasks like text-generation, summarization, and translation, include the "text" field. For chat tasks, use "messages". For image tasks (like image-to-text, image-classification, object-detection, etc.), supply input using either "url" or "base64". For audio tasks such as automatic-speech-recognition, provide audio using "url" or "base64". Question-based tasks like question-answering require both "question" and "context". Zero-shot tasks need "candidate_labels" and may also require "text" or "image". Some tasks, like unconditional-image-generation, may not need any input. Always refer to the specific model's task to determine the required fields.

The body is of type object.

Response

200
application/json
Successful response from the model.

The response is of type object.