Authorizations
Set Authorization
header to Key BYTEZ_KEY
(e.g. 'Authorization': 'Key ABC123')
Path Parameters
The model you want to run (e.g., openai-community/gpt2
).
Body
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.
Input text to be processed by the model (used for most NLP tasks).
An array of chat messages representing the conversation history. Each message must have a role
(system
, user
, or assistant
) and content
.
The content
can be:
- A simple string - An array of content blocks where each block has a
type
(e.g.text
,image
,audio
, orvideo
) and the corresponding data viatext
,url
, orbase64
.
URL to an image, audio, or video file (used for image/audio/video tasks).
Handles Base64-encoded image, audio, or video. Using URLs is recommended to avoid large payloads, which slow your requests down.
Question text (used in question-answering tasks).
Context paragraph (used in question-answering).
List of candidate labels (used in zero-shot tasks).
Enable/disable text streaming.
Similar to stream, but for media. Streams back media instead returning it in JSON format.
Model-specific parameters. See model documentation for details.