# About
Source: https://docs.bytez.com/company/about
The story, mission, and community behind Bytez
## Our Story
Bytez started as a community project out of NeurIPS. Thank you, Lee Campbell, who believed in us during the idea stage. Thank you to the volunteers at NeurIPS, CVPR, and the entire ML community. Your support and your contributions are the foundation of Bytez and the future of open science.
## Our Mission
The mission of Bytez is to make open source AI easy to discover, understand, and use.
We believe there is an opportunity to make open models as trusted and ready-to-use as closed models, to the benefit of all developers and researchers.
## Join the Community
We're building Bytez in the open, alongside the AI community. Join the conversation on [Discord](https://discord.com/invite/Z723PfCFWf) or follow us on [X](https://x.com/Bytez) for the latest model releases and research insights.
## Help Improve Bytez
We’re committed to building the best developer experience for AI builders. Have feedback? Let us know on [Discord](https://discord.com/invite/Z723PfCFWf) or open an issue on [GitHub](https://github.com/Bytez-com/docs/issues).
# Blog
Source: https://docs.bytez.com/company/blog
Discover our insights and explore the highlights from NeurIPS 2024.
# Integrations & Roadmap
Source: https://docs.bytez.com/company/roadmap
Stay updated on our integration milestones and upcoming features.
| **Feature** | **Status** |
| -------------------------- | -------------- |
| Open Source Integrations | ✅ Complete |
| Closed Source Integrations | ✅ Complete |
| Python Library | ✅ Complete |
| JavaScript Library | ✅ Complete |
| Julia Library | 🚧 Coming Soon |
| LangChain Integration | 🚧 Coming Soon |
## Key
* ✅ **Complete**: Feature is available and fully functional
* 🚧 **Coming Soon**: Feature is in development and will be available in a future release.
For more updates, check back often or reach out to our teamn via [email](mailto:team@bytez.com) or [Discord](https://discord.com/invite/Z723PfCFWf)
# Solutions
Source: https://docs.bytez.com/company/solutions
Bridging the gap between SOTA AI research and production-ready models.
## Agent
Unlock the power of AI research with our intelligent agent. It’s read every AI paper and model, offering:
* Summaries of ML topics, papers, and models.
* Citation tracking for deeper insights.
* Guidance to select the best models for your projects.
Discover, demo, and deploy AI with ease.
## Interactive AI Papers
Accelerate your understanding of AI research with interactive papers linked to related resources—blogs, forums, videos, and more.
## Model API
Experiment, prototype, and deploy faster with our standardized Model API:
* Access over **40K models** across **33K tasks**.
* Work seamlessly with both open-source and proprietary models.
* Enjoy serverless pricing with standardized inputs for ultimate flexibility.
## Model Sandboxes
Test and explore models in real-time with Bytez Model Sandboxes:
* Demo any model to see how it works instantly.
* Understand performance and capabilities in seconds.
## Paper API
Coming soon!
# Anthropic
Source: https://docs.bytez.com/http-reference/examples/closed-source/anthropic
post /models/v2/anthropic/{model}
Send requests to any Anthropic model by specifying the `{model}` placeholder in the path.
# Cohere
Source: https://docs.bytez.com/http-reference/examples/closed-source/cohere
post /models/v2/cohere/{model}
Send requests to any Cohere model by specifying the `{model}` placeholder in the path.
# Google
Source: https://docs.bytez.com/http-reference/examples/closed-source/google
post /models/v2/google/{model}
Send requests to any Google model by specifying the `{model}` placeholder in the path.
# Mistral
Source: https://docs.bytez.com/http-reference/examples/closed-source/mistral
post /models/v2/mistral/{model}
Send requests to any Mistral model by specifying the `{model}` placeholder in the path.
# OpenAI
Source: https://docs.bytez.com/http-reference/examples/closed-source/openai
post /models/v2/openai/{model}
Send requests to any OpenAI model by specifying the `{model}` placeholder in the path.
# audio-classification
Source: https://docs.bytez.com/http-reference/examples/open-source/audio-classification/audio-classification
post /models/v2/aaraki/wav2vec2-base-finetuned-ks
Classify audio clips into predefined categories such as speech emotion, sound detection, and music genres
# audio-text-to-text
Source: https://docs.bytez.com/http-reference/examples/open-source/audio-text-to-text/audio-text-to-text
post /models/v2/Qwen/Qwen2-Audio-7B-Instruct
Chat with AI models using text and audio. Also known as audio-text-to-text
# automatic-speech-recognition
Source: https://docs.bytez.com/http-reference/examples/open-source/automatic-speech-recognition/automatic-speech-recognition
post /models/v2/facebook/data2vec-audio-base-960h
Convert spoken language into written text for transcription services, voice assistants, and accessibility features
# chat
Source: https://docs.bytez.com/http-reference/examples/open-source/chat/chat
post /models/v2/Qwen/Qwen3-4B
Use the latest AI chat models
# depth-estimation
Source: https://docs.bytez.com/http-reference/examples/open-source/depth-estimation/depth-estimation
post /models/v2/vinvino02/glpn-nyu
Predict object distances from a camera using depth estimation models for robotics, AR, and autonomous vehicles
# document-question-answering
Source: https://docs.bytez.com/http-reference/examples/open-source/document-question-answering/document-question-answering
post /models/v2/cloudqi/CQI_Visual_Question_Awnser_PT_v0
Answer questions based on document content for tasks like contract analysis, document understanding, and information retrieval
# feature-extraction
Source: https://docs.bytez.com/http-reference/examples/open-source/feature-extraction/feature-extraction
post /models/v2/nomic-ai/nomic-embed-text-v1.5
Convert text into vectors (embeddings) that capture semantic meaning
# fill-mask
Source: https://docs.bytez.com/http-reference/examples/open-source/fill-mask/fill-mask
post /models/v2/almanach/camembert-base
Predict missing words in a sentence for tasks like text completion, language modeling, and text generation
# image-classification
Source: https://docs.bytez.com/http-reference/examples/open-source/image-classification/image-classification
post /models/v2/google/vit-base-patch16-224
Categorize images into predefined classes for tasks like object recognition, medical imaging, and security systems
# image-feature-extraction
Source: https://docs.bytez.com/http-reference/examples/open-source/image-feature-extraction/image-feature-extraction
post /models/v2/nomic-ai/nomic-embed-vision-v1
Extract features from images for tasks like object detection, image classification, and image retrieval
# image-segmentation
Source: https://docs.bytez.com/http-reference/examples/open-source/image-segmentation/image-segmentation
post /models/v2/sayeed99/segformer-b3-fashion
Divide an image into multiple segments for applications like medical imaging, object detection, and computer vision tasks
# image-text-to-text
Source: https://docs.bytez.com/http-reference/examples/open-source/image-text-to-text/image-text-to-text
post /models/v2/google/gemma-3-4b-it
Chat with AI models using text and images. Also known as image-text-to-text
# image-to-text
Source: https://docs.bytez.com/http-reference/examples/open-source/image-to-text/image-to-text
post /models/v2/Salesforce/blip-image-captioning-base
Generate textual descriptions from images for tasks like image captioning, content generation, and accessibility features
# mask-generation
Source: https://docs.bytez.com/http-reference/examples/open-source/mask-generation/mask-generation
post /models/v2/facebook/sam-vit-base
Generate masks for objects in images for tasks like image segmentation, medical imaging, and computer vision applications
# object-detection
Source: https://docs.bytez.com/http-reference/examples/open-source/object-detection/object-detection
post /models/v2/facebook/detr-resnet-50
Identify and locate objects in images for applications like security systems, autonomous driving, and retail analytics
# question-answering
Source: https://docs.bytez.com/http-reference/examples/open-source/question-answering/question-answering
post /models/v2/deepset/roberta-base-squad2
Answer questions based on a given context for applications like customer support, information retrieval, and educational tools
# sentence-similarity
Source: https://docs.bytez.com/http-reference/examples/open-source/sentence-similarity/sentence-similarity
post /models/v2/sentence-transformers/all-MiniLM-L6-v2
Measure how similar two sentences are for applications like duplicate question detection, paraphrase detection, and text clustering
# summarization
Source: https://docs.bytez.com/http-reference/examples/open-source/summarization/summarization
post /models/v2/ainize/bart-base-cnn
Summarization involves creating concise summaries of longer texts. Use cases include news summarization, document summarization, and generating abstracts
# text-classification
Source: https://docs.bytez.com/http-reference/examples/open-source/text-classification/text-classification
post /models/v2/AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon
Categorize text into predefined classes for applications like sentiment analysis, spam detection, and topic classification
# text-generation
Source: https://docs.bytez.com/http-reference/examples/open-source/text-generation/text-generation
post /models/v2/openai-community/gpt2
Generate text from an initial prompt for applications like story generation, dialogue systems, and creative writing
# text-to-audio
Source: https://docs.bytez.com/http-reference/examples/open-source/text-to-audio/text-to-audio
post /models/v2/facebook/musicgen-stereo-small
Send a text input to generate an audio output
# text-to-image
Source: https://docs.bytez.com/http-reference/examples/open-source/text-to-image/text-to-image
post /models/v2/dreamlike-art/dreamlike-photoreal-2.0
Generate images using text
# text-to-speech
Source: https://docs.bytez.com/http-reference/examples/open-source/text-to-speech/text-to-speech
post /models/v2/suno/bark-small
Convert text into natural-sounding speech for applications like virtual assistants, accessibility features, and content creation
# text-to-video
Source: https://docs.bytez.com/http-reference/examples/open-source/text-to-video/text-to-video
post /models/v2/ali-vilab/text-to-video-ms-1.7b
Generate videos from textual descriptions for applications like content creation, entertainment, and education
# text2text-generation
Source: https://docs.bytez.com/http-reference/examples/open-source/text2text-generation/text2text-generation
post /models/v2/google/flan-t5-base
Generate text from input text for applications like text completion, content generation, and dialogue systems
# token-classification
Source: https://docs.bytez.com/http-reference/examples/open-source/token-classification/token-classification
post /models/v2/dslim/bert-base-NER
Identify and categorize tokens in text for Named Entity Recognition (NER), Part-of-Speech tagging, and other NLP tasks
# translation
Source: https://docs.bytez.com/http-reference/examples/open-source/translation/translation
post /models/v2/Helsinki-NLP/opus-mt-en-zh
Translate text from one language to another for multilingual communication, content localization, and language learning
# unconditional-image-generation
Source: https://docs.bytez.com/http-reference/examples/open-source/unconditional-image-generation/unconditional-image-generation
post /models/v2/afshr/cam_finetune
Randomly generate images without an input
# video-classification
Source: https://docs.bytez.com/http-reference/examples/open-source/video-classification/video-classification
post /models/v2/ahmedabdo/video-classifier
Categorize videos into predefined classes for applications in video content analysis, security surveillance, and media organization
# video-text-to-text
Source: https://docs.bytez.com/http-reference/examples/open-source/video-text-to-text/video-text-to-text
post /models/v2/llava-hf/LLaVA-NeXT-Video-7B-hf
Chat with AI models using text and videos. Also known as video-text-to-text
# visual-question-answering
Source: https://docs.bytez.com/http-reference/examples/open-source/visual-question-answering/visual-question-answering
post /models/v2/Salesforce/blip-vqa-base
Answer questions based on image content for applications like interactive learning, accessibility features, and content analysis
# zero-shot-classification
Source: https://docs.bytez.com/http-reference/examples/open-source/zero-shot-classification/zero-shot-classification
post /models/v2/facebook/bart-large-mnli
Classify text into categories not seen during training for applications like intent detection, content moderation, and dynamic classification
# zero-shot-image-classification
Source: https://docs.bytez.com/http-reference/examples/open-source/zero-shot-image-classification/zero-shot-image-classification
post /models/v2/BilelDJ/clip-hugging-face-finetuned
Classify images into categories not seen during training for applications like novel object recognition, transfer learning, and few-shot learning
# zero-shot-object-detection
Source: https://docs.bytez.com/http-reference/examples/open-source/zero-shot-object-detection/zero-shot-object-detection
post /models/v2/google/owlv2-base-patch16-finetuned
Detect objects in images without prior training on those specific objects. Use cases include novel object detection, transfer learning, and few-shot learning
# Chat Completions
Source: https://docs.bytez.com/http-reference/examples/openai-compliant/chatCompletionsExample
Use OpenAI-compatible endpoints for chat and text completions via OpenAI clients, supporting streaming and custom parameters.
Provides chat completions for all open source models that are `chat`, `audio-text-to-text`, `image-text-to-text`, `video-text-to-text`, it also supports chat completions models from the closed source providers, `openai`, `anthropic`, `mistral`, `cohere`, and `google`.
To specify a provider, prefix the model with the provider, e.g. `gpt-4` should be passed in as `openai/gpt4`
We provide access to models from `openai`, `mistral`, and `google`.
You will need to supply a header `provider-key` in order to make requests to `cohere` models.
**NOTE:** Logprobs are supported for all models!
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const messages = [
{ role: "system", content: "You are a friendly chatbot" },
{ role: "assistant", content: "Hello, I'm a friendly bot" },
{ role: "user", content: "Hello bot, what is the capital of England?" }
];
const response = await client.chat.completions.create({
model: "Qwen/Qwen3-4B",
messages,
max_tokens: 150,
temperature: 0.7
});
console.log(response);
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
messages = [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "assistant", "content": "Hello, I'm a friendly bot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"},
]
response = client.chat.completions.create(
model="Qwen/Qwen3-4B", messages=messages, temperature=0.7, max_tokens=150
)
print(response)
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/openai/v1/chat/completions' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "Qwen/Qwen3-4B",
"messages": [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "assistant", "content": "Hello, Im a friendly bot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"}
],
"temperature": 0.7,
"max_tokens": 150
}'
```
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const messages = [
{ role: "system", content: "You are a friendly chatbot" },
{ role: "assistant", content: "Hello, I'm a friendly bot" },
{ role: "user", content: "Hello bot, what is the capital of England?" }
];
const stream = await client.chat.completions.create({
model: "Qwen/Qwen3-4B",
messages,
max_tokens: 150,
temperature: 0.7,
stream: true
});
let text = '';
for await (const event of stream) {
if (event.choices[0].finish_reason) {
break;
}
const content = event.choices[0].delta.content;
text += content;
console.log(content);
}
console.log({ text });
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
messages = [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "assistant", "content": "Hello, I'm a friendly bot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"},
]
stream = client.chat.completions.create(
model="Qwen/Qwen3-4B",
messages=messages,
temperature=0.7,
max_tokens=150,
stream=True,
)
text = ""
for event in stream:
if event.choices[0].finish_reason:
break
content = event.choices[0].delta.content
text += content
print(content)
print({"text": text})
```
```bash http theme={null}
curl -N -X POST 'https://api.bytez.com/models/v2/openai/v1/chat/completions' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "Qwen/Qwen3-4B",
"messages": [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "assistant", "content": "Hello, Im a friendly bot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"}
],
"temperature": 0.7,
"max_tokens": 150,
"stream": true
}'
```
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const messages = [
{ role: "system", content: "You are a friendly chatbot" },
{ role: "assistant", content: "Hello, I'm a friendly bot" },
{ role: "user", content: "Hello bot, what is the capital of England?" }
];
const response = await client.chat.completions.create({
model: "openai/gpt-4",
messages,
max_tokens: 150,
temperature: 0.7
});
console.log(response);
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
messages = [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "assistant", "content": "Hello, I'm a friendly bot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"},
]
response = client.chat.completions.create(
model="openai/gpt-4", messages=messages, temperature=0.7, max_tokens=150
)
print(response)
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/openai/v1/chat/completions' \
-H 'Authorization: BYTEZ_KEY' \
-H 'provider-key: PROVIDER_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "openai/gpt-4",
"messages": [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "assistant", "content": "Hello, Im a friendly bot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"}
],
"temperature": 0.7,
"max_tokens": 150
}'
```
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const messages = [
{ role: "system", content: "You are a friendly chatbot" },
{ role: "assistant", content: "Hello, I'm a friendly bot" },
{ role: "user", content: "Hello bot, what is the capital of England?" }
];
const stream = await client.chat.completions.create({
model: "openai/gpt-4",
messages,
max_tokens: 150,
temperature: 0.7,
stream: true
});
let text = '';
for await (const event of stream) {
if (event.choices[0].finish_reason) {
break;
}
const content = event.choices[0].delta.content;
text += content;
console.log(content);
}
console.log({ text });
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
messages = [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "assistant", "content": "Hello, I'm a friendly bot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"},
]
stream = client.chat.completions.create(
model="openai/gpt-4",
messages=messages,
temperature=0.7,
max_tokens=150,
stream=True,
)
text = ""
for event in stream:
if event.choices[0].finish_reason:
break
content = event.choices[0].delta.content
text += content
print(content)
print({"text": text})
```
```bash http theme={null}
curl -N -X POST 'https://api.bytez.com/models/v2/openai/v1/chat/completions' \
-H 'Authorization: BYTEZ_KEY' \
-H 'provider-key: PROVIDER_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "openai/gpt-4",
"messages": [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "assistant", "content": "Hello, Im a friendly bot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"}
],
"temperature": 0.7,
"max_tokens": 150,
"stream": true
}'
```
# Completions
Source: https://docs.bytez.com/http-reference/examples/openai-compliant/completionsExample
Use OpenAI-compatible endpoints for chat and text completions via OpenAI clients, supporting streaming and custom parameters.
Provides completions for all open source models that are `text-generation`, it also supports completions models from the closed source providers, `openai`, `anthropic`, `mistral`, `cohere`, and `google`.
To specify a provider, prefix the model with the provider, e.g. `davinci-002` should be passed in as `openai/davinci-002`
We provide access to models from `openai`, `mistral`, and `google`.
You will need to supply a header `provider-key` in order to make requests to `cohere` models.
**NOTE:** Logprobs are supported for all models!
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const response = await client.completions.create({
model: "openai-community/gpt2",
prompt: "Write a short poem about AI",
temperature: 0.7,
max_tokens: 150
});
console.log(response);
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
response = client.completions.create(
model="openai-community/gpt2",
prompt="Write a short poem about AI",
temperature=0.7,
max_tokens=150
)
print(response)
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/openai/v1/completions' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "openai-community/gpt2",
"prompt": "Write a short poem about AI",
"temperature": 0.7,
"max_tokens": 150
}'
```
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const stream = await client.completions.create({
model: "openai-community/gpt2",
prompt: "Write a short poem about AI",
max_tokens: 150,
temperature: 0.7,
stream: true
});
let text = '';
for await (const event of stream) {
if (event.choices[0].finish_reason) {
break;
}
const content = event.choices[0].text;
text += content;
console.log(content);
}
console.log({ text });
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
stream = client.completions.create(
model="openai-community/gpt2",
prompt="Write a short poem about AI",
max_tokens=150,
temperature=0.7,
stream=True
)
text = ""
for event in stream:
if event.choices[0].finish_reason:
break
content = event.choices[0].text
text += content
print(content)
print({"text": text})
```
```bash http theme={null}
curl -N -X POST 'https://api.bytez.com/models/v2/openai/v1/completions' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "openai-community/gpt2",
"prompt": "Write a short poem about AI",
"max_tokens": 150,
"temperature": 0.7,
"stream": true
}'
```
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const response = await client.completions.create({
model: "openai/davinci-002",
prompt: "Write a short poem about AI",
temperature: 0.7,
max_tokens: 150
});
console.log(response);
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
response = client.completions.create(
model="openai/davinci-002",
prompt="Write a short poem about AI",
temperature=0.7,
max_tokens=150
)
print(response)
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/openai/v1/completions' \
-H 'Authorization: BYTEZ_KEY' \
-H 'provider-key: PROVIDER_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "openai/davinci-002",
"prompt": "Write a short poem about AI",
"temperature": 0.7,
"max_tokens": 150
}'
```
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const stream = await client.completions.create({
model: "openai/davinci-002",
prompt: "Write a short poem about AI",
max_tokens: 150,
temperature: 0.7,
stream: true
});
let text = '';
for await (const event of stream) {
if (event.choices[0].finish_reason) {
break;
}
const content = event.choices[0].text;
text += content;
console.log(content);
}
console.log({ text });
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
stream = client.completions.create(
model="openai/davinci-002",
prompt="Write a short poem about AI",
max_tokens=150,
temperature=0.7,
stream=True
)
text = ""
for event in stream:
if event.choices[0].finish_reason:
break
content = event.choices[0].text
text += content
print(content)
print({"text": text})
```
```bash http theme={null}
curl -N -X POST 'https://api.bytez.com/models/v2/openai/v1/completions' \
-H 'Authorization: BYTEZ_KEY' \
-H 'provider-key: PROVIDER_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "openai/davinci-002",
"prompt": "Write a short poem about AI",
"max_tokens": 150,
"temperature": 0.7,
"stream": true
}'
```
# Responses
Source: https://docs.bytez.com/http-reference/examples/openai-compliant/responsesExample
Use the OpenAI-compatible Responses endpoint via OpenAI clients, supporting streaming, tool calling, and reasoning ("thinking") parameters.
Provides Responses for all closed source providers: `openai`, and `anthropic`.
The Responses API is the unified successor to Chat Completions: you send `input` (text, images, files, tool outputs, etc.) and receive a `response` object that can contain messages, tool calls, and (for reasoning models) reasoning items.
**Note**, anthropic does not yet support tool calls.
To specify a provider, prefix the model with the provider. For example, `gpt-5.1` should be passed as `openai/gpt-5.1`.
## Thinking (Reasoning) parameters
Some OpenAI reasoning models (e.g. `openai/gpt-5.x`, `openai/o3`, `openai/o4-mini`) support the `reasoning` object:
* `reasoning.effort`: `"none" | "low" | "medium" | "high" | ...` (model-dependent)
* `reasoning.summary`: `"none" | "auto" | "detailed"` (optional)
All Anthropic models should support thinking.
⚠️ `max_output_tokens` limits **reasoning tokens + visible output tokens**, so if you increase `reasoning.effort`, consider raising `max_output_tokens`.
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const response = await client.responses.create({
model: "openai/gpt-5.1",
input: [
{ role: "system", content: "You are a friendly chatbot" },
{ role: "user", content: "Hello bot, what is the capital of England?" }
],
// Thinking controls (OpenAI reasoning models only)
reasoning: {
effort: "medium", // try: "none" | "low" | "medium" | "high" (model-dependent)
summary: "auto" // "none" | "auto" | "detailed"
},
// Caps reasoning + visible output tokens together
max_output_tokens: 300
});
console.log("Answer:", response.output_text);
// Optional: read a reasoning summary item (if requested & returned)
const reasoningItem = response.output?.find((it) => it.type === "reasoning");
if (reasoningItem?.summary?.length) {
console.log("Reasoning summary:", reasoningItem.summary.map(s => s.text).join("\n"));
}
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
response = client.responses.create(
model="openai/gpt-5.1",
input=[
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"},
],
reasoning={
"effort": "medium",
"summary": "auto",
},
max_output_tokens=300,
)
print("Answer:", response.output_text)
reasoning_items = [it for it in response.output if it.type == "reasoning"]
if reasoning_items and getattr(reasoning_items[0], "summary", None):
print("Reasoning summary:", reasoning_items[0].summary[0].text)
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/openai/v1/responses' \
-H 'Authorization: BYTEZ_KEY' \
-H 'provider-key: PROVIDER_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "openai/gpt-5.1",
"input": [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"}
],
"reasoning": { "effort": "medium", "summary": "auto" },
"max_output_tokens": 300
}'
```
```javascript javascript theme={null}
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "BYTEZ_KEY",
baseURL: "https://api.bytez.com/models/v2/openai/v1"
});
const stream = await client.responses.create({
model: "openai/gpt-5.1",
input: [
{ role: "system", content: "You are a friendly chatbot" },
{ role: "user", content: "Hello bot, what is the capital of England?" }
],
reasoning: { effort: "medium", summary: "auto" },
max_output_tokens: 400,
stream: true
});
let text = "";
let reasoningSummary = "";
for await (const event of stream) {
if (event.type === "response.output_text.delta") {
text += event.delta;
process.stdout.write(event.delta);
}
// Optional: stream reasoning summary text (if enabled by reasoning.summary)
if (event.type === "response.reasoning_summary_text.delta") {
reasoningSummary += event.delta;
}
if (event.type === "response.completed") break;
}
console.log("\n\nFinal:", { text });
if (reasoningSummary) console.log("\nReasoning summary:\n", reasoningSummary);
```
```python python theme={null}
from openai import OpenAI
client = OpenAI(
api_key="BYTEZ_KEY",
base_url="https://api.bytez.com/models/v2/openai/v1"
)
stream = client.responses.create(
model="openai/gpt-5.1",
input=[
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"},
],
reasoning={"effort": "medium", "summary": "auto"},
max_output_tokens=400,
stream=True,
)
text = ""
reasoning_summary = ""
for event in stream:
if event.type == "response.output_text.delta":
text += event.delta
print(event.delta, end="", flush=True)
elif event.type == "response.reasoning_summary_text.delta":
reasoning_summary += event.delta
elif event.type == "response.completed":
break
print("\n\nFinal:", {"text": text})
if reasoning_summary:
print("\nReasoning summary:\n", reasoning_summary)
```
```bash http theme={null}
curl -N -X POST 'https://api.bytez.com/models/v2/openai/v1/responses' \
-H 'Authorization: BYTEZ_KEY' \
-H 'provider-key: PROVIDER_KEY' \
-H 'Content-Type: application/json' \
--data '{
"model": "openai/gpt-5.1",
"input": [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"}
],
"reasoning": { "effort": "medium", "summary": "auto" },
"max_output_tokens": 400,
"stream": true
}'
```
# Models
Source: https://docs.bytez.com/http-reference/list/models
get /models/v2/list/models
Retrieve a list of available models for various tasks. Use the query parameter `task` to filter by task type, e.g. `chat`.
# Tasks
Source: https://docs.bytez.com/http-reference/list/tasks
get /models/v2/list/tasks
Retrieve a list of tasks
# Run Model
Source: https://docs.bytez.com/http-reference/model/run
post /models/v2/{modelId}
Runs an open/closed model. Acts serverlessly. (We manage everything behind the scenes.)
# Chat Completions
Source: https://docs.bytez.com/http-reference/oaiCompliant/chatCompletions
post /models/v2/openai/v1/chat/completions
Sends a prompt to an OpenAI compatible chat completion model and returns a completion. Provides completions for open source models that are `text-generation`, `chat`, `audio-text-to-text`, `image-text-to-text`, `video-text-to-text`, and also supports closed source providers `openai`, `anthropic`, `mistral`, `cohere`, and `google`. To send a request to a closed source provider, prefix your model with their provider name, e.g. `openai/gpt-4`.
# Completions
Source: https://docs.bytez.com/http-reference/oaiCompliant/completions
post /models/v2/openai/v1/completions
Sends a prompt to an OpenAI compatible completion model and returns a completion. Provides completions for open source models that are `text-generation`, `chat`, `audio-text-to-text`, `image-text-to-text`, `video-text-to-text`, and also supports closed source providers `openai`, `anthropic`, `mistral`, `cohere`, and `google`. To send a request to a closed source provider, prefix your model with their provider name, e.g. `openai/gpt-4`.
# Responses
Source: https://docs.bytez.com/http-reference/oaiCompliant/responses
post /models/v2/openai/v1/responses
Sends input to an OpenAI compatible Responses model and returns a unified response object. Supports text and chat-style input, streaming, tools, and (for supported reasoning models) "thinking" via the `reasoning` object. To send a request to a closed source provider, prefix your model with their provider name, e.g. `openai/gpt-5.1`.
# Overview
Source: https://docs.bytez.com/http-reference/overview
An Overview of CRUD Operations & Unified Input Schemas for SOTA AI models
# Quickstart
Run Inference (POST) - Execute a Model
* `Endpoint`: POST `/models/v2/openai-community/{model}`
* `Purpose`: Run inference on an open-source model.
```json Request Body theme={null}
{
"text": "Hello, how are you?",
"stream": false,
"params": {
"min_length": 10,
"max_length": 50
}
}
```
```json Response theme={null}
{
"output": "I am doing well, thank you!"
}
```
***
# Unified Input Formats
Bytez simplifies building with 175k+ `Open Source` and `Closed Source` AI models by standardizing
inputs across 33 ML tasks. This consistency eliminates the need to adjust for varying input
structures, allowing seamless integration for `text`, `messages`, `image`, or `multiple` inputs.
## Why Standardization?
* Reduces integration complexity.
* Enables task/provider switching without reformatting inputs.
## Input Schemas
### Text
For models that process `text`:
```json json theme={null}
{
"text": "Input text",
"stream": false,
"params": { "max_length": 100, "temperature": 0.7 }
}
```
Tasks: `fill-mask`, `summarization`, `text-to-speech`, `translation`, `text-generation`
### Messages
For `chat`, `audio-text-to-text`, `image-text-to-text`, and `video-text-to-text` tasks:
```json json theme={null}
{
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "What's the weather like today?" }
]
}
```
Tasks: `chat`, `audio-text-to-text`, `image-text-to-text`, and `video-text-to-text`
### Image
For image processing, use either:
`URL`:
```json json theme={null}
{ "url": "https://example.com/image.jpg" }
```
`Base64`:
```json json theme={null}
{ "base64": "data:image/webp;base64,..." }
```
Tasks: `image-classification`, `object-detection`, `image-to-Text`.
### Multi-Input
For models needing both `text` and `image` or `audio` or `video`:
```json json theme={null}
{
"text": "What's in the image?",
"url": "https://example.com/image.jpg"
}
```
Tasks: `visual-question-answering`, `zero-shot-classification`, etc.
This unified schema accelerates development and ensures compatibility across diverse AI tasks.
# LangChain
Source: https://docs.bytez.com/integrations/langchain
Using `LangChain` with the Bytez API
This guide provides a simple introduction to using the `langchain_bytez` package to interact with
the Bytez API. It covers `text generation`, `chat models` (including multimodal),
`image-text-to-text`, `video-text-to-text`, `audio-text-to-text`, streaming, async operations, and
provides examples to get you started.
## Installation
First, install the [package](https://pypi.org/project/langchain-bytez/):
```bash theme={null}
pip install langchain_bytez
```
## Authentication
You'll need your Bytez API key to use the package. Set it as an environment variable:
```bash theme={null}
export API_KEY="YOUR_BYTEZ_API_KEY"
```
Replace `"YOUR_BYTEZ_API_KEY"` with your actual API key.
## Text Generation (LLM)
The `BytezLLM` class allows you to use Bytez for text generation.
```python python theme={null}
import os
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.schema import HumanMessage, SystemMessage
from langchain_bytez import BytezLLM
API_KEY = os.environ.get("API_KEY")
bytez_llm = BytezLLM(
model_id="microsoft/phi-2", # Replace with your desired model ID
api_key=API_KEY,
capacity={
"min": 1,
"max": 1,
},
params={"max_new_tokens": 64},
timeout=10, # minutes before expiring
streaming=True,
callbacks=[StreamingStdOutCallbackHandler()],
)
# Create a prompt
messages = [
SystemMessage(
content="You are a helpful assistant that answers questions clearly and concisely."
),
HumanMessage(content="List the phylums in the biological taxonomy"),
]
# Generate text
results = bytez_llm.invoke(messages) # or use bytez_llm.predict("your prompt here")
print(results) # Prints out the text
```
## Chat Models
The `BytezChatModel` class provides a convenient way to interact with chat models.
```python python theme={null}
import os
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.schema import HumanMessage, SystemMessage
from langchain_bytez import BytezChatModel
API_KEY = os.environ.get("API_KEY")
bytez_chat_model = BytezChatModel(
model_id="microsoft/Phi-3-mini-4k-instruct", # Replace with your model ID
api_key=API_KEY,
capacity={
"min": 1,
"max": 1,
},
params={"max_new_tokens": 64},
timeout=10, # minutes before expiring
streaming=True,
callbacks=[StreamingStdOutCallbackHandler()],
)
messages = [
SystemMessage(
content="You are a helpful assistant that answers questions clearly and concisely."
),
HumanMessage(content="List the phylums in the biological taxonomy"),
]
results = bytez_chat_model.invoke(messages)
print(results) # Prints out the text
```
## Multimodal Models
`BytezChatModel` also supports multimodal models by accepting a list of messages, where the content of each message can be text or image data.
```python python theme={null}
import os
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.schema import SystemMessage, HumanMessage
from langchain_bytez import BytezChatModel, BytezStdOutCallbackHandler # Helpful for debugging
API_KEY = os.environ.get("API_KEY")
bytez_chat_model = BytezChatModel(
model_id="meta-llama/Llama-3.2-11B-Vision-Instruct", # Replace with your model ID
api_key=API_KEY,
capacity={
"min": 1,
"max": 1,
},
params={"max_new_tokens": 64},
callbacks=[StreamingStdOutCallbackHandler(), BytezStdOutCallbackHandler()], # Helpful for debugging
)
system_message = SystemMessage(
content=[
{"type": "text", "text": "You are a helpful assistant that answers questions clearly and concisely."},
]
)
human_message = HumanMessage(
content=[
{"type": "text", "text": "What is this image?"},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*",
},
]
)
messages = [system_message, human_message]
response = bytez_chat_model.invoke(messages)
print(response) # Prints out the text
# Support for streaming
iterator = bytez_chat_model.stream(messages)
for chunk in iterator:
print(chunk.content, end='')
# Support for batch requests
batch_prompts = [messages, messages, messages] # List of message lists
batch_response = bytez_chat_model.batch(batch_prompts)
print(batch_response)
# Support for async, which looks like this:
iterator = bytez_chat_model.batch_as_completed(batch_prompts)
for index, output in iterator:
print(f"Batch {index}: {output}")
```
## Image-to-Text, Video-to-Text, and Audio-to-Text
Bytez supports different kinds of multimodal models for extracting information from media. The input format is similar to the image example, but you'll use the appropriate content type for each media type. These are also supported with both synchronous and asynchronous invocations, as well as streaming and batch. Make sure you replace the model\_id with a model that supports the type of input you are giving it.
### Image-to-Text
```python python theme={null}
import os
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.schema import HumanMessage, SystemMessage
from langchain_bytez import BytezChatModel, BytezStdOutCallbackHandler
API_KEY = os.environ.get("API_KEY")
bytez_chat_model = BytezChatModel(
model_id="meta-llama/Llama-3.2-11B-Vision-Instruct", # Replace with a model supporting image input
api_key=API_KEY,
capacity={
"min": 1,
"max": 1,
},
params={"max_new_tokens": 64},
callbacks=[StreamingStdOutCallbackHandler(), BytezStdOutCallbackHandler()],
)
system_message = SystemMessage(
content=[
{"type": "text", "text": "You are a helpful assistant that describes images."},
]
)
human_message = HumanMessage(
content=[
{"type": "text", "text": "Describe the image in detail."},
{
"type": "image",
"url": "https://your-image-url.com/image.jpg", # Replace with your image URL
},
]
)
messages = [system_message, human_message]
response = bytez_chat_model.invoke(messages)
print(response)
Use code with caution.
```
### Video-to-Text
```python python theme={null}
import os
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.schema import HumanMessage, SystemMessage
from langchain_bytez import BytezChatModel, BytezStdOutCallbackHandler
API_KEY = os.environ.get("API_KEY")
bytez_chat_model = BytezChatModel(
model_id="your-video-to-text-model-id", # Replace with a model supporting video input
api_key=API_KEY,
capacity={
"min": 1,
"max": 1,
},
params={"max_new_tokens": 128}, # adjust for desired output length
callbacks=[StreamingStdOutCallbackHandler(), BytezStdOutCallbackHandler()],
)
system_message = SystemMessage(
content=[
{"type": "text", "text": "You are a helpful assistant that describes videos."},
]
)
human_message = HumanMessage(
content=[
{"type": "text", "text": "Summarize the video."},
{
"type": "video",
"url": "https://your-video-url.com/video.mp4", # Replace with your video URL
},
]
)
messages = [system_message, human_message]
response = bytez_chat_model.invoke(messages)
print(response)
Use code with caution.
```
### Audio-to-Text
```python python theme={null}
import os
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.schema import HumanMessage, SystemMessage
from langchain_bytez import BytezChatModel, BytezStdOutCallbackHandler
API_KEY = os.environ.get("API_KEY")
bytez_chat_model = BytezChatModel(
model_id="your-audio-to-text-model-id", # Replace with a model supporting audio input
api_key=API_KEY,
capacity={
"min": 1,
"max": 1,
},
params={"max_new_tokens": 128}, # adjust for desired output length
callbacks=[StreamingStdOutCallbackHandler(), BytezStdOutCallbackHandler()],
)
system_message = SystemMessage(
content=[
{"type": "text", "text": "You are a helpful assistant that transcribes audio."},
]
)
human_message = HumanMessage(
content=[
{"type": "text", "text": "Transcribe the audio."},
{
"type": "audio",
"url": "https://your-audio-url.com/audio.mp3", # Replace with your audio URL
},
]
)
messages = [system_message, human_message]
response = bytez_chat_model.invoke(messages)
print(response)
Use code with caution.
```
## Streaming
To enable streaming, set `streaming=True` in the constructor. This allows you to receive responses in real-time. The provided StreamingStdOutCallbackHandler is a simple way to see the streamed output.
```python python theme={null}
import os
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.schema import HumanMessage, SystemMessage
from langchain_bytez import BytezChatModel
API_KEY = os.environ.get("API_KEY")
bytez_chat_model = BytezChatModel(
model_id="microsoft/Phi-3-mini-4k-instruct",
api_key=API_KEY,
capacity={
"min": 1,
"max": 1,
},
params={"max_new_tokens": 64},
timeout=10,
streaming=True,
callbacks=[StreamingStdOutCallbackHandler()],
)
messages = [
SystemMessage(
content="You are a helpful assistant that answers questions clearly and concisely."
),
HumanMessage(content="List the phylums in the biological taxonomy"),
]
results = bytez_chat_model.invoke(messages) # Results are streamed to stdout because of the callback
Use code with caution.
```
## Extending Callback Handlers (Observability)
You can extend the behavior of the model runs by creating your own callback handlers. `BytezStdOutCallbackHandler` is provided as a utility, but you're free to create your own for enhanced logging, metrics, or other custom behavior.
```python python theme={null}
import os
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.schema import HumanMessage, SystemMessage
from langchain_bytez import BytezChatModel, BytezStdOutCallbackHandler
API_KEY = os.environ.get("API_KEY")
bytez_chat_model = BytezChatModel(
model_id="microsoft/Phi-3-mini-4k-instruct",
api_key=API_KEY,
capacity={
"min": 1,
"max": 1,
},
params={"max_new_tokens": 64},
timeout=10,
streaming=True,
callbacks=[StreamingStdOutCallbackHandler(), BytezStdOutCallbackHandler()], # custom + standard handler
)
messages = [
SystemMessage(
content="You are a helpful assistant that answers questions clearly and concisely."
),
HumanMessage(content="List the phylums in the biological taxonomy"),
]
results = bytez_chat_model.invoke(messages)
Use code with caution.
Python
Shutting Down and Updating Your Cluster
You can manage the underlying Bytez cluster:
bytez_chat_model.shutdown_cluster()
bytez_chat_model.capacity = {
"min": 2, # Increase the minimum number of instances
"max": 3, # Increase the maximum number of instances
}
bytez_chat_model.update_cluster()
Use code with caution.
```
## Async Operations
The `langchain_bytez` package also fully supports asynchronous operations using asyncio.
```python python theme={null}
import asyncio
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain_bytez import BytezChatModel, BytezStdOutCallbackHandler
async def test_chat_async():
bytez_chat_model = BytezChatModel(
model_id="meta-llama/Llama-3.2-11B-Vision-Instruct",
api_key=API_KEY,
capacity={
"min": 1,
"max": 1,
},
params={"max_new_tokens": 64},
timeout=10, # minutes before expiring
streaming=True,
callbacks=[StreamingStdOutCallbackHandler(), BytezStdOutCallbackHandler()],
)
response = await bytez_chat_model.ainvoke(messages) # async invoke
async_iterator = bytez_chat_model.astream(messages) # async stream
async for chunk in async_iterator:
print(chunk.content, end='') # Prints out the text
batch_response = await bytez_chat_model.abatch(batch_prompts) # async batch
for response in batch_response:
print(response) # Prints out the text
async_iterator = bytez_chat_model.abatch_as_completed(batch_prompts) # async batch as completed
async for index, output in async_iterator:
print(f"Batch {index}: {output}")
pass
if __name__ == "__main__":
result = asyncio.run(test_chat_async())
Use code with caution.
```
## Configuration Options (kwargs)
Both BytezChatModel and BytezLLM accept the following keyword arguments:
* `model_id (str)`: The Bytez model ID (required). Check the Bytez documentation for available models.
* `api_key (str)`: Your Bytez API key (required).
* `capacity (dict)`: Controls cluster scaling. Supports min, max, and desired keys.
* `timeout (int)`: Timeout in minutes for cluster shutdown after the last inference (optional).
* `streaming (bool)`: Enable streaming responses (default: False).
* `params (dict)`: Parameters to pass to the Bytez API (optional), such as max\_new\_tokens.
* `headers (dict)`: Custom headers to send with the API request (optional). Useful for authentication.
* `http_timeout_s (float)`: Timeout in seconds for the HTTP request (default: 300 seconds).
## Resources
Feedback: Join our [Discord](https://discord.com/invite/Z723PfCFWf) or open an issue on GitHub
## Important Notes
* Replace placeholder `model_id` values with actual Bytez model IDs. Ensure that the model ID you select supports the media type that you provide.
* Ensure your `API_KEY` environment variable is correctly set.
* Check the Bytez documentation for the latest model availability and API parameters.
* For more complex use cases, consider creating your own custom callback handlers to monitor the lifecycle of model runs.
# Billing & Credits
Source: https://docs.bytez.com/model-api/docs/billing
How billing works for open and closed models
Bytez uses a credit-based system. Credits are consumed when you run models, and how they're consumed depends on whether you're using closed-source or open-source models.
## Plans
* Run open models up to 7B parameters
* Access all closed model providers
* 1 concurrent request (open models)
* 10 requests/second (closed models)
* Credits refresh every 4 weeks
* Run open models up to 120B parameters
* Access all closed model providers
* Rate limits scale with credits purchased
* Unlimited closed model requests
* Add credits anytime
## How Credits Work
Credits are a unified currency across all models on Bytez. When you run a model, credits are deducted from your balance based on usage.
| Model Type | How Credits Are Consumed |
| ------------- | ----------------------------------------------------------------- |
| Closed models | Based on provider pricing (per token, per image, per video, etc.) |
| Open models | Per second of inference |
Your credits purchased in the last 4 weeks determine two things:
1. **Which open models you can access** - Larger open models require more credits purchased to unlock
2. **Your rate limits** - More credits purchased unlocks more concurrent requests
Adding credits immediately unlocks higher tiers. You don't need to wait for the next billing
cycle.
### Credit Unlock Thresholds
| Credits Purchased (last 4 weeks) | Open Model Access | Concurrent Requests (7B) |
| -------------------------------- | ----------------- | ------------------------ |
| \$0 (Free) | Up to 7B | 1 |
| \$3+ | Up to 7B | 4 |
| \$10+ | Up to 35B | 4 |
| \$25+ | Up to 70B | 10 |
| \$50+ | Up to 120B | 20 |
| \$100+ | Up to 120B | 40 |
| \$500+ | Up to 120B | 200 |
| \$1,000+ | Up to 120B | 400 |
Credits expire 4 weeks after purchase. Use them or lose them!
***
## Closed Model Billing
For closed-source models (OpenAI, Anthropic, Google, Mistral, Cohere), we pass through the provider's pricing plus a small platform fee.
```
Your cost = Provider price + 2% platform fee
```
Providers charge differently depending on the model and modality - per token for text, per image for image generation, per second for video, etc. We pass through whatever the provider charges.
**Example:** If OpenAI charges per M tokens, you pay per M tokens.
The platform fee covers:
* Unified API translation and standardization
* Request routing and load balancing
* Usage tracking and analytics
* Support and reliability infrastructure
You get a single API, single billing, and single format across all providers.
### What's included
* **Pass-through pricing** - Pay only for what the provider charges
* **No minimum** - No monthly minimums or commitments
* **Real-time pricing** - We pass through provider rates as they change
***
## Open Model Billing
Open-source models run on our **serverless GPU infrastructure**. You're billed per second of inference time - no cold start fees, no idle charges.
```
Your cost = Inference time (seconds) x Rate for model size
```
### Pricing by Model Size
Bigger models use more VRAM, so they cost more per second:
| Model Size | Per Second | Per Hour |
| ---------- | ---------- | -------- |
| 7B | \$0.000072 | \~\$0.26 |
| 15B | \$0.000108 | \~\$0.39 |
| 35B | \$0.000144 | \~\$0.52 |
| 70B | \$0.000216 | \~\$0.78 |
| 120B | \$0.00036 | \~\$1.30 |
Our base rate is **\$0.0000045/GB-second** of VRAM used.
For comparison:
* **Bytez:** \$0.0000045/GB-sec (with Nvidia GPUs)
* **AWS Lambda:** \$0.0000167/GB-sec (CPUs only)
That's **3.7x cheaper** than AWS Lambda, and you get serverless Nvidia GPUs, not just serverless CPUs.
### What's included
* **Per-second billing** - Billed in 1-second increments
* **No cold start fees** - You don't pay while the model loads
* **No idle charges** - You don't pay when not running inference
* **No reserved instances** - No commitments, no minimums
***
## Auto-Reload
Auto-reload automatically tops up your credit balance when it runs low, so your API calls never fail unexpectedly.
### How it works
| Setting | Default | Description |
| ------------- | ------- | --------------------------------------------- |
| Threshold | \$3 | Reload triggers when balance drops below this |
| Reload amount | \$10 | Amount added to your balance |
| Monthly max | \$100 | Maximum auto-reload spend per month |
When your credit balance falls below \$3 (default), auto-reload activates
Your saved payment method is charged \$10 (default reload amount)
\$10 in credits is immediately added to your balance
Auto-reload stops if you've hit your monthly maximum (\$100 default)
### If Auto-Reload is Disabled
When auto-reload is off and your credits run out, you may get an API response like this:
```json theme={null}
{
"status": 402,
"error": "Payment Required",
"message": "Insufficient credits. Please add credits to continue."
}
```
If you're running production workloads, we recommend enabling auto-reload to prevent unexpected
failures.
### Configuring Auto-Reload
You can enable, disable, or adjust auto-reload settings in your [API Dashboard](https://bytez.com/api/billing).
***
## Auto-Scaling (Open Models)
By default, if you exceed your open model rate limits, requests are rejected with a rate-limit error.
If you want your rate limits to automatically scale with your traffic in production, add `autoScale: true` to your request:
```javascript theme={null}
const response = await fetch('https://api.bytez.com/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'meta-llama/Llama-3-70b',
messages: [...],
autoScale: true
})
});
```
When enabled, the system auto-purchases extra credits required to keep auto-scaling. You can control your **Max Monthly Spend** in your [API Dashboard](https://bytez.com/api/billing) to cap costs. This way you can auto-scale and control your budget.
For closed models, you get unlimited rate limits on a pay-as-you-go basis - no auto-scaling needed.
## Billing Cycle
* **Billing:** None
* **Credits:** free credits, refreshed every 4 weeks
* **Expiration:** Credits expire 4 weeks after grant
* **Billing:** charged on signup date
* **Credits:** \$5 in credits granted each
billing cycle
* **Expiration:** All credits expire 4 weeks after grant
### Adding Credits Mid-Cycle
You can add credits at any time. When you do:
1. **Immediate access** - Higher model tiers and rate limits unlock instantly
2. **No proration** - You get the full credit amount immediately
3. **Credits stack** - Purchased credits add to your existing balance
**Example:** You're on `Pay-as-you-go` with remaining. You add . Your new balance is ,
which immediately unlocks 70B models and 10 concurrent requests.
***
## FAQ
In-flight requests will complete. Only new requests will fail with a 402 error.
Credits are non-refundable and expire 4 weeks after purchase.
Visit your [API Dashboard](https://bytez.com/api/billing) to see real-time usage, credit
balance, and request history.
Larger models require more GPU resources (VRAM). Requiring a minimum purchase threshold ensures
you have enough credits to complete meaningful workloads without running out mid-task.
For high-volume usage (>/month), contact us at [team@bytez.com](mailto:team@bytez.com) for
custom pricing.
# Provider specific params
Source: https://docs.bytez.com/model-api/docs/closed-source-params
Using closed source models with params
[Don't care about the details? Please see the examples below](#examples-non-exhaustive)
## Passing provider-specific parameters
Bytez forwards parameters directly to the underlying model provider.
This allows you to pass **any supported parameters** as defined in the
official provider API docs:
Parameters are supplied as the **second argument** to `model.run(...)` with SDKs, or as
fields in the REST body when using **curl/HTTP**. Bytez does not modify or restrict
provider-specific options — it passes them through verbatim.
Always check the provider docs [below](#expanded-list-of-links-to-provider-supported-params) for the most accurate and up-to-date list
of supported options and parameter behavior.
The raw response from the provider is included in the `provider` property of the object returned by our API.
## Expanded list of links to provider supported params
* **Responses API**\
[https://developers.openai.com/api/reference/resources/responses/methods/create](https://developers.openai.com/api/reference/resources/responses/methods/create)
*chat · summarization · translation · token-classification · text-classification · image-text-to-text · image-to-text · text-to-image · text-to-video · text-to-speech · text-to-audio · automatic-speech-recognition*
* **Chat Completions API**
[https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create)
*chat · summarization · translation · audio-text-to-text · image-text-to-text · video-text-to-text*
* **Generate Content API**
[https://ai.google.dev/api/generate-content](https://ai.google.dev/api/generate-content)
*chat · summarization · translation · text-classification · image-text-to-text · image-to-text ·
text-to-image · text-to-video*
* **Messages API**
[https://platform.claude.com/docs/en/api/messages/create](https://platform.claude.com/docs/en/api/messages/create)
*chat · summarization · translation · text-classification · image-text-to-text · image-to-text*
* **Chat Completions API**
[https://docs.mistral.ai/api/endpoint/chat#operation-chat\_completion\_v1\_chat\_completions\_post](https://docs.mistral.ai/api/endpoint/chat#operation-chat_completion_v1_chat_completions_post)
*chat · summarization · translation · text-classification · token-classification*
* **Embeddings API**
[https://docs.mistral.ai/api/endpoint/embeddings](https://docs.mistral.ai/api/endpoint/embeddings)
*feature-extraction · sentence-similarity*
* **OCR API**
[https://docs.mistral.ai/api/endpoint/ocr#operation-ocr\_v1\_ocr\_post](https://docs.mistral.ai/api/endpoint/ocr#operation-ocr_v1_ocr_post)
*image-to-text*
* **Audio Transcriptions API**
[https://docs.mistral.ai/api/endpoint/audio/transcriptions#operation-audio\_api\_v1\_transcriptions\_post](https://docs.mistral.ai/api/endpoint/audio/transcriptions#operation-audio_api_v1_transcriptions_post)
*automatic-speech-recognition · audio-text-to-text*
* **Chat API**
[https://docs.cohere.com/reference/chat](https://docs.cohere.com/reference/chat)
*chat*
## Examples (Non-Exhaustive)
```javascript javascript theme={null}
import Bytez from "bytez.js";
// insert your key
const sdk = new Bytez("BYTEZ_KEY");
// choose your model
const model = sdk.model("openai/o4-mini-deep-research");
// send to the model
const { error, output, provider } = await model.run(
"Best places to eat vietnamese food near melbourne florida, only search 5 websites",
{
tools: [
{
type: "web_search"
}
]
});
console.log({ error, output });
console.log(provider);
```
```javascript javascript theme={null}
import Bytez from "bytez.js";
// insert your key
const sdk = new Bytez("BYTEZ_KEY");
// choose your model
const model = sdk.model("openai/sora-2-pro");
// send to the model
const { error, output, provider } = await model.run(
"Best places to eat vietnamese food near melbourne florida, only search 5 websites",
{
// generate a 7 second video instead of the default 4 second video
seconds: 7
});
console.log({ error, output });
console.log(provider);
```
```javascript javascript theme={null}
import Bytez from "bytez.js";
// insert your key
const sdk = new Bytez("BYTEZ_KEY");
// choose your model
const model = sdk.model("google/gemini-2.5-pro");
// provide the model your chat session
const messages = [
{
role: "user",
content: [
{
type: "text",
text: [
"What is the latest model available?",
"Compute the sum of the first 50 prime numbers using code execution.",
"Then compare two roast chicken recipes and their cooking times."
].join(" ")
}
]
}
];
// send to model with provider-specific parameters
const { error, output, provider } = await model.run(messages, {
max_new_tokens: 1024 * 16,
tools: [
{ googleSearch: {} },
{ urlContext: {} },
{ codeExecution: {} }
],
urls: ["https://www.google.com"]
});
console.log({ error, output });
console.log(provider);
```
```javascript javascript theme={null}
import Bytez from "bytez.js";
// insert your key
const sdk = new Bytez("BYTEZ_KEY");
// choose your model
const model = sdk.model("gemini-3-pro-preview");
// provide the model your chat session
const messages = [
{
role: "user",
content: [
{
type: "text",
text: "How does AI work?"
}
]
}
];
// send to model with provider-specific parameters
const { error, output, provider } = await model.run(messages, {
max_new_tokens: 1024 * 16,
thinkingConfig: {
thinkingLevel: "low",
}
});
console.log({ error, output });
console.log(provider);
```
```javascript javascript theme={null}
import Bytez from "bytez.js";
// insert your key
const sdk = new Bytez("BYTEZ_KEY");
// choose your model
const model = sdk.model("openai/o4-mini-deep-research");
// send to the model
const { error, output, provider } = await model.run(
"Best places to eat vietnamese food near melbourne florida, only search 5 websites",
{
tools: [
{
type: "web_search"
}
]
});
console.log({ error, output });
console.log(provider);
```
# Containers
Source: https://docs.bytez.com/model-api/docs/containers
Run open models locally, offline, and on edge devices
Every open-source model on Bytez is available as a Docker image. Pull it, run it, and make requests to `localhost`.
Images are hosted on Docker Hub under the `bytez` namespace. The image name matches the model ID with `/` replaced by `_`.
```bash theme={null}
# Pattern: bytez/{org}_{model-name}
docker pull bytez/qwen_qwen3-4b
```
Find model IDs at [bytez.com/models](https://bytez.com/models) or via the [List Models API](/http-reference/list/models).
```bash theme={null}
docker run -d \
-e KEY=YOUR_BYTEZ_KEY \
-e PORT=8000 \
-p 8000:8000 \
bytez/qwen_qwen3-4b
```
This runs the container in the background. Get your API key at [bytez.com/api/key](https://bytez.com/api/key).
**View logs**
```bash theme={null}
# Follow logs (live)
docker logs -f
# View recent logs
docker logs
```
To run attached and watch logs directly, replace `-d` with `-it`. Press `Ctrl+C` to stop.
**Environment Variables**
| Variable | Required | Default | Description |
| -------- | -------- | ------- | ----------------------------------------------------------- |
| `KEY` | Yes | - | Your Bytez API key (for analytics and update notifications) |
| `PORT` | No | `80` | Port the server listens on inside the container |
| `DEVICE` | No | `auto` | Where to load weights: `auto`, `cuda`, or `cpu` |
**Docker Options**
| Option | Description |
| ------------------------------ | -------------------------------------------------------- |
| `--gpus all` | Enable GPU acceleration (requires NVIDIA drivers + CUDA) |
| `-v /local/path:/server/model` | Mount a local directory for weight caching |
| `-p HOST:CONTAINER` | Map container port to host port |
**Run on GPU**
```bash theme={null}
docker run -d \
--gpus all \
-e KEY=YOUR_BYTEZ_KEY \
-e PORT=8000 \
-p 8000:8000 \
bytez/qwen_qwen3-4b
```
**Run on CPU**
```bash theme={null}
docker run -d \
-e DEVICE=cpu \
-e KEY=YOUR_BYTEZ_KEY \
-e PORT=8000 \
-p 8000:8000 \
bytez/qwen_qwen3-4b
```
**Cache Weights Locally**
Avoid re-downloading weights on every run by mounting a local directory:
```bash theme={null}
docker run -d \
--gpus all \
-v /path/to/cache:/server/model \
-e HF_HOME=/server/model \
-e KEY=YOUR_BYTEZ_KEY \
-e PORT=8000 \
-p 8000:8000 \
bytez/qwen_qwen3-4b
```
If you're going to create the same model container multiple times, then for large models (70B+), caching is highly recommended. Downloads can take hours otherwise.
Once the container is running, send POST requests to `/run`.
**Chat Models**
```bash theme={null}
curl -X POST http://localhost:8000/run \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "system", "content": "You are a helpful assistant" },
{ "role": "user", "content": "What is the capital of France?" }
],
"stream": false,
"params": {
"max_new_tokens": 100,
"temperature": 0.7
}
}'
```
**Streaming**
Set `"stream": true` to receive tokens as they're generated:
```bash theme={null}
curl -X POST http://localhost:8000/run \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "Write a haiku about coding" }
],
"stream": true
}'
```
Different model tasks require different inputs. Here's a quick reference:
| Task | Required Fields | Example |
| ------------------------------ | --------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `chat` | `messages` | `{"messages": [{"role": "user", "content": "Hi"}]}` |
| `text-generation` | `text` | `{"text": "Once upon a time"}` |
| `image-text-to-text` | `messages` with image | `{"messages": [{"role": "user", "content": [{"type": "text", "text": "Describe this"}, {"type": "image", "url": "..."}]}]}` |
| `text-to-image` | `text` | `{"text": "A cat in space"}` |
| `automatic-speech-recognition` | `url` or `base64` | `{"url": "https://example.com/audio.wav"}` |
| `feature-extraction` | `text` | `{"text": "Embed this sentence"}` |
See complete request/response params and examples for all 30+ task types.
Create a self-contained image with weights baked in - no internet required at runtime.
**Step 1: Run the container once to download weights**
```bash theme={null}
docker run -d \
-e KEY=YOUR_BYTEZ_KEY \
-e PORT=8000 \
-p 8000:8000 \
--name my-model \
bytez/qwen_qwen3-4b
```
Wait for the model to fully load (check with `docker logs -f my-model`). Once ready, stop it:
```bash theme={null}
docker stop my-model
```
**Step 2: Save as a new image**
```bash theme={null}
docker commit my-model my-model-offline
```
**Step 3: Run offline (no internet needed)**
```bash theme={null}
docker run -d \
-e KEY=YOUR_BYTEZ_KEY \
-e PORT=8000 \
-p 8000:8000 \
my-model-offline
```
To verify it's truly offline, add `--network none` to the run command.
**Optional: Export for another machine**
```bash theme={null}
# Save to a file
docker save my-model-offline -o my-model-offline.tar
# Load on another machine
docker load -i my-model-offline.tar
```
**Container won't start**
Check that Docker is installed and running. For GPU support, ensure you have NVIDIA drivers and the NVIDIA Container Toolkit installed.
**Out of memory**
Try `DEVICE=auto` to split the model across GPU and CPU memory. For large models, you may need more VRAM or system RAM.
**Slow first request**
The first request loads model weights into memory. Subsequent requests are fast. Use weight caching (`-v` mount) to speed up container restarts.
**Model only works with specific DEVICE setting**
Some models only support `auto`, `cuda`, or `cpu`. If one doesn't work, try another.
***
## Need Help?
Get live support from the community
# Get started
Source: https://docs.bytez.com/model-api/docs/get-started
Install our API libraries and run inference in seconds
You can use the API with any programming language that can make HTTP requests,
but we recommend using one of our official SDKs for ease of use and convenience.
We have libraries for Python, JavaScript, and Julia.
Using Python 3.9+, JavaScript, or Julia, install the appropriate package:
```bash javascript theme={null}
// use your favorite package manager
npm i bytez.js
yarn add bytez.js
```
```bash python theme={null}
pip install bytez
```
Bytez allows you to use open-source and closed-source models with a single API key.
## Use open-source models
1. Copy your key from the [API Dashboard](https://bytez.com/api).
2. Use your Bytez Key in requests
```javascript javascript theme={null}
import Bytez from "bytez.js";
const sdk = new Bytez("BYTEZ_KEY");
```
```python python theme={null}
from bytez import Bytez
sdk = Bytez("BYTEZ_KEY")
```
```bash http theme={null}
# add an Authorization header, with value "Key {BYTEZ_KEY}"
curl -X GET "https://api.bytez.com/models/v2/some-endpoint" \
-H "Authorization: BYTEZ_KEY"
```
You're now set to use open source models on Bytez!
## Use closed-source models
To use a closed-source model, you'll need an account with the model provider. For example, if you want to use `OpenAI` models, you'll need an OpenAI key. We call your closed source key a "provider key"
1. Copy your key from the [API Dashboard](https://bytez.com/api).
2. Use your Bytez Key AND closed-source provider key in requests.
```bash http theme={null}
# add a "provider-key" header, and set its value to "{KEY}"
curl -X GET "https://api.bytez.com/models/v2/some-endpoint" \
-H "Authorization: BYTEZ_KEY" \
-H "provider-key: {your-key}"
```
We securely route your requests as a pass-through service. Your API keys are never stored or logged by Bytez; they are only used to authenticate directly with the model provider.
**Recommendation:** Use a dedicated API key for Bytez for maximum security and traceability.
* **Billing:** No extra Bytez fees for closed-source models; you're billed directly by the provider based on usage associated with your key.
* **Integration:** Seamlessly use the same input format for all models (open and closed-source).
If you need help with any of this, please DM us in [Discord](https://discord.com/invite/Z723PfCFWf)
or submit an issue on [GitHub](https://github.com/Bytez-com/docs/issues). We're happy to help.
Running is a model is easy. Just select the model and pass it an input
```javascript javascript theme={null}
import Bytez from "bytez.js";
const sdk = new Bytez("BYTEZ_KEY");
const modelId = "openai-community/gpt2"
const model = sdk.model(model_id)
const { error, output } = await model.run("Once upon a time")
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
sdk = Bytez("BYTEZ_KEY")
model = sdk.model("openai-community/gpt2")
result = model.run("Once upon a time")
print(result.output)
```
```bash http theme={null}
curl -X POST "https://api.bytez.com/models/v2/openai-community/gpt2" \
-H "Authorization: BYTEZ_KEY" \
-H "Content-Type: application/json" \
--data '{ "text": "Once upon a time" }'
```
Read more about our schema by visiting our HTTP reference.
You can list all the tasks, models, and running models using the API.
### Tasks
A `task` defines a specific function a model performs (e.g., object-detection). Multiple models might be available for the same task. To list all tasks supported by Bytez, run the following command:
```javascript javascript theme={null}
import Bytez from "bytez.js";
const sdk = new Bytez("BYTEZ_KEY");
const { error, output } = await sdk.list.tasks()
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
sdk = Bytez("BYTEZ_KEY")
result = sdk.list.tasks()
print(result.output)
```
```bash http theme={null}
curl -X GET "https://api.bytez.com/models/v2/list/tasks" \
-H "Authorization: BYTEZ_KEY"
```
### Models
A `model` refers to a software function with unique identifier. `Models` execute `tasks`. For example, the model `google/vit-base-patch16-224` executes `image-classification`. To list all open-source models supported by Bytez, run the following command:
```javascript javascript theme={null}
import Bytez from "bytez.js";
const sdk = new Bytez("BYTEZ_KEY");
const { error, output } = await sdk.list.models()
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
sdk = Bytez("BYTEZ_KEY")
result = sdk.list.models()
print(result.output)
```
```bash http theme={null}
curl -X GET "https://api.bytez.com/models/v2/list/models" \
-H "Authorization: BYTEZ_KEY"
```
# Request a model
Source: https://docs.bytez.com/model-api/docs/requestAModel
How to request a model
Bytez is able to automatically process any model on Huggingface. To request a model, you must hit our endpoint at:
`https://api.bytez.com/models/v2/request/{modelId}`
## Request a model
Example model ID:
`Finisha-F-scratch/Lamina-basic`
Endpoint used in the examples below:
`https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic`
```javascript title="JavaScript" theme={null}
const url = 'https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic';
fetch(url, {
method: 'POST',
})
.then((response) => response.json())
.then((data) => {
console.log('Response:', data);
})
.catch((error) => {
console.error('Error:', error);
});
```
```python title="Python" theme={null}
import requests
url = "https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic"
response = requests.post(url)
print("Status Code:", response.status_code)
print("Response JSON:", response.json())
```
```bash title="curl" theme={null}
curl -X POST \
https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic
```
### Expected Response
```json theme={null}
{
"error": null,
"output": "Job queued"
}
```
# API Status Dashboard
Source: https://docs.bytez.com/model-api/docs/status
Check uptime and health of the API
Something not right? DM us in [Discord](https://discord.com/invite/Z723PfCFWf) or submit an issue
on [GitHub](https://github.com/Bytez-com/docs/issues).
# audio-classification
Source: https://docs.bytez.com/model-api/docs/task/audio-classification
Classify audio clips into predefined categories such as speech emotion, sound detection, and music genres
Send an audio file to a model for classification
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('aaraki/wav2vec2-base-finetuned-ks');
// provide the model with input
const input = {
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/audio-classification/audio.wav"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("aaraki/wav2vec2-base-finetuned-ks")
# provide the model with input
input = {
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/audio-classification/audio.wav"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/aaraki/wav2vec2-base-finetuned-ks' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/audio-classification/audio.wav"
}'
```
You can send the **audio** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# Multimodal - Audio
Source: https://docs.bytez.com/model-api/docs/task/audio-text-to-text
Chat with AI models using text and audio. Also known as audio-text-to-text
Send a conversation to a model to generate text from text and audio
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Qwen/Qwen2-Audio-7B-Instruct');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
];
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Qwen/Qwen2-Audio-7B-Instruct")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
]
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Qwen/Qwen2-Audio-7B-Instruct' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
]
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Qwen/Qwen2-Audio-7B-Instruct');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
];
// provide the model with params
const params = {
"temperature": 0
};
// send to the model
const { error, output } = await model.run(input, params);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Qwen/Qwen2-Audio-7B-Instruct")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
]
# provide the model with params
params = {
"temperature": 0
}
# send to the model
result = model.run(input, params)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Qwen/Qwen2-Audio-7B-Instruct' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
],
"params": {
"temperature": 0
}
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Qwen/Qwen2-Audio-7B-Instruct');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
];
// set streaming to "true"
const stream = true;
// send to the model
const readStream = await model.run(input, stream);
let text = '';
for await (const tokens of readStream) {
text += tokens;
console.log(tokens);
}
// observe the output
console.log({ text });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Qwen/Qwen2-Audio-7B-Instruct")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
]
# set streaming to "true"
stream = True
# send to the model
readStream = model.run(input, stream=stream)
text = ""
for tokens in readStream:
text += tokens
print(tokens)
# observe the output
print({"text": text})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Qwen/Qwen2-Audio-7B-Instruct' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
],
"stream": true
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Qwen/Qwen2-Audio-7B-Instruct');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
];
// provide the model with params
const params = {
"temperature": 0
};
// set streaming to "true"
const stream = true;
// send to the model
const readStream = await model.run(input, params, stream);
let text = '';
for await (const tokens of readStream) {
text += tokens;
console.log(tokens);
}
// observe the output
console.log({ text });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Qwen/Qwen2-Audio-7B-Instruct")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
]
# provide the model with params
params = {
"temperature": 0
}
# set streaming to "true"
stream = True
# send to the model
readStream = model.run(input, params, stream)
text = ""
for tokens in readStream:
text += tokens
print(tokens)
# observe the output
print({"text": text})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Qwen/Qwen2-Audio-7B-Instruct' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this audio"
},
{
"type": "audio",
"url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3"
}
]
}
],
"params": {
"temperature": 0
},
"stream": true
}'
```
# automatic-speech-recognition
Source: https://docs.bytez.com/model-api/docs/task/automatic-speech-recognition
Convert spoken language into written text for transcription services, voice assistants, and accessibility features
Send an audio file to an ASR model to generate text
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('facebook/data2vec-audio-base-960h');
// provide the model with input
const input = {
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/automatic-speech-recognition/input.flac"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("facebook/data2vec-audio-base-960h")
# provide the model with input
input = {
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/automatic-speech-recognition/input.flac"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/facebook/data2vec-audio-base-960h' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/automatic-speech-recognition/input.flac"
}'
```
You can send the **audio** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# Get started
Source: https://docs.bytez.com/model-api/docs/task/chat
Use the latest AI chat models
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Qwen/Qwen3-4B');
// provide the model with input
const input = [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
];
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Qwen/Qwen3-4B")
# provide the model with input
input = [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
]
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Qwen/Qwen3-4B' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
]
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Qwen/Qwen3-4B');
// provide the model with input
const input = [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
];
// provide the model with params
const params = {
"temperature": 0
};
// send to the model
const { error, output } = await model.run(input, params);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Qwen/Qwen3-4B")
# provide the model with input
input = [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
]
# provide the model with params
params = {
"temperature": 0
}
# send to the model
result = model.run(input, params)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Qwen/Qwen3-4B' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
],
"params": {
"temperature": 0
}
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Qwen/Qwen3-4B');
// provide the model with input
const input = [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
];
// set streaming to "true"
const stream = true;
// send to the model
const readStream = await model.run(input, stream);
let text = '';
for await (const tokens of readStream) {
text += tokens;
console.log(tokens);
}
// observe the output
console.log({ text });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Qwen/Qwen3-4B")
# provide the model with input
input = [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
]
# set streaming to "true"
stream = True
# send to the model
readStream = model.run(input, stream=stream)
text = ""
for tokens in readStream:
text += tokens
print(tokens)
# observe the output
print({"text": text})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Qwen/Qwen3-4B' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
],
"stream": true
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Qwen/Qwen3-4B');
// provide the model with input
const input = [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
];
// provide the model with params
const params = {
"temperature": 0
};
// set streaming to "true"
const stream = true;
// send to the model
const readStream = await model.run(input, params, stream);
let text = '';
for await (const tokens of readStream) {
text += tokens;
console.log(tokens);
}
// observe the output
console.log({ text });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Qwen/Qwen3-4B")
# provide the model with input
input = [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
]
# provide the model with params
params = {
"temperature": 0
}
# set streaming to "true"
stream = True
# send to the model
readStream = model.run(input, params, stream)
text = ""
for tokens in readStream:
text += tokens
print(tokens)
# observe the output
print({"text": text})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Qwen/Qwen3-4B' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "system",
"content": "You are a friendly chatbot"
},
{
"role": "assistant",
"content": "Hello, I'm a friendly bot"
},
{
"role": "user",
"content": "Hello bot, what is the capital of England?"
}
],
"params": {
"temperature": 0
},
"stream": true
}'
```
# Closed source models
Source: https://docs.bytez.com/model-api/docs/task/chat-closed-source
Using chat and chat multi-modal models with closed source providers (OpenAI, Anthropic, etc)
```javascript javascript theme={null}
import Bytez from "bytez.js";
// insert your key
const sdk = new Bytez("BYTEZ_KEY");
// choose your chat model + insert your provider key
// const model = sdk.model("google/gemini-2.0-flash", "YOUR_GEMINI_KEY");
const model = sdk.model("openai/gpt-4o", "YOUR_OPEN_AI_KEY");
// provide the model your chat session
const messages = [
{ role: "system", content: "You are a friendly chatbot" },
{ role: "assistant", content: "Hello, I'm a friendly bot" },
{ role: "user", content: "Hello bot, what is the capital of England?" },
]
// send to model
const { error, output, provider } = await model.run(messages);
// `provider` is the raw OpenAI output
console.log({ error, output, provider });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your chat model
#
# model = sdk.model("google/gemini-2.0-flash", "YOUR_GEMINI_KEY")
model = sdk.model("openai/gpt-4o", "YOUR_OPEN_AI_KEY")
# provide the model your chat session
messages = [
{"role": "system", "content": "You are a friendly chatbot"},
{"role": "assistant", "content": "Hello, I'm a friendly bot"},
{"role": "user", "content": "Hello bot, what is the capital of England?"},
]
# send to model
result = model.run(messages)
# `provider` is the raw OpenAI output
print({ "error": result.error, "output": result.output, "provider": result.provider })
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/openai/gpt-4o' \
-H 'Authorization: BYTEZ_KEY' \
-H 'provider-key: YOUR_OPEN_AI_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{ "role": "system", "content": "You are a friendly chatbot" },
{ "role": "assistant", "content": "Hello, Im a friendly bot" },
{ "role": "user", "content": "Hello bot, what is the capital of England?" }
]
}'
```
# depth-estimation
Source: https://docs.bytez.com/model-api/docs/task/depth-estimation
Predict object distances from a camera using depth estimation models for robotics, AR, and autonomous vehicles
Send an image to a depth estimation model to generate a depth map
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('vinvino02/glpn-nyu');
// provide the model with input
const input = {
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("vinvino02/glpn-nyu")
# provide the model with input
input = {
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/vinvino02/glpn-nyu' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# document-question-answering
Source: https://docs.bytez.com/model-api/docs/task/document-question-answering
Answer questions based on document content for tasks like contract analysis, document understanding, and information retrieval
Send an image of a document along with a question to get relevant answers
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('cloudqi/CQI_Visual_Question_Awnser_PT_v0');
// provide the model with input
const input = {
"question": "Whats the total cost?",
"url": "https://templates.invoicehome.com/invoice-template-us-neat-750px.png"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("cloudqi/CQI_Visual_Question_Awnser_PT_v0")
# provide the model with input
input = {
"question": "Whats the total cost?",
"url": "https://templates.invoicehome.com/invoice-template-us-neat-750px.png"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/cloudqi/CQI_Visual_Question_Awnser_PT_v0' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"question": "Whats the total cost?",
"url": "https://templates.invoicehome.com/invoice-template-us-neat-750px.png"
}'
```
You can send the **document image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# feature-extraction
Source: https://docs.bytez.com/model-api/docs/task/feature-extraction
Convert text into vectors (embeddings) that capture semantic meaning
Each feature extraction model is different, so check readme.md for the model manual. Below is an example of text embedding model
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('nomic-ai/nomic-embed-text-v1.5');
// provide the model with input
const input = "search_document: Turn this text into a vector";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("nomic-ai/nomic-embed-text-v1.5")
# provide the model with input
input = "search_document: Turn this text into a vector"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/nomic-ai/nomic-embed-text-v1.5' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "search_document: Turn this text into a vector"
}'
```
# fill-mask
Source: https://docs.bytez.com/model-api/docs/task/fill-mask
Predict missing words in a sentence for tasks like text completion, language modeling, and text generation
Send a masked sentence to a model to predict the missing word
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('almanach/camembert-base');
// provide the model with input
const input = "The capital of France is .";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("almanach/camembert-base")
# provide the model with input
input = "The capital of France is ."
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/almanach/camembert-base' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "The capital of France is ."
}'
```
# image-classification
Source: https://docs.bytez.com/model-api/docs/task/image-classification
Categorize images into predefined classes for tasks like object recognition, medical imaging, and security systems
Send an image to a model to generate classification labels
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('google/vit-base-patch16-224');
// provide the model with input
const input = {
"url": "https://www.padoniavets.com/sites/default/files/field/image/cats-and-dogs.jpg"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("google/vit-base-patch16-224")
# provide the model with input
input = {
"url": "https://www.padoniavets.com/sites/default/files/field/image/cats-and-dogs.jpg"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/google/vit-base-patch16-224' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://www.padoniavets.com/sites/default/files/field/image/cats-and-dogs.jpg"
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# image-feature-extraction
Source: https://docs.bytez.com/model-api/docs/task/image-feature-extraction
Extract features from images for tasks like object detection, image classification, and image retrieval
For example, generate visual embeddings from an image
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('nomic-ai/nomic-embed-vision-v1');
// provide the model with input
const input = {
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("nomic-ai/nomic-embed-vision-v1")
# provide the model with input
input = {
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/nomic-ai/nomic-embed-vision-v1' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# image-segmentation
Source: https://docs.bytez.com/model-api/docs/task/image-segmentation
Divide an image into multiple segments for applications like medical imaging, object detection, and computer vision tasks
Send an image to a model to generate segmentation masks
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('sayeed99/segformer-b3-fashion');
// provide the model with input
const input = {
"url": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("sayeed99/segformer-b3-fashion")
# provide the model with input
input = {
"url": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/sayeed99/segformer-b3-fashion' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9"
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# Multimodal - Vision
Source: https://docs.bytez.com/model-api/docs/task/image-text-to-text
Chat with AI models using text and images. Also known as image-text-to-text
Send a conversation to a model to generate text from text and audio
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('google/gemma-3-4b-it');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
];
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("google/gemma-3-4b-it")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
]
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/google/gemma-3-4b-it' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
]
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('google/gemma-3-4b-it');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
];
// provide the model with params
const params = {
"temperature": 0
};
// send to the model
const { error, output } = await model.run(input, params);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("google/gemma-3-4b-it")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
]
# provide the model with params
params = {
"temperature": 0
}
# send to the model
result = model.run(input, params)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/google/gemma-3-4b-it' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
],
"params": {
"temperature": 0
}
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('google/gemma-3-4b-it');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
];
// set streaming to "true"
const stream = true;
// send to the model
const readStream = await model.run(input, stream);
let text = '';
for await (const tokens of readStream) {
text += tokens;
console.log(tokens);
}
// observe the output
console.log({ text });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("google/gemma-3-4b-it")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
]
# set streaming to "true"
stream = True
# send to the model
readStream = model.run(input, stream=stream)
text = ""
for tokens in readStream:
text += tokens
print(tokens)
# observe the output
print({"text": text})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/google/gemma-3-4b-it' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
],
"stream": true
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('google/gemma-3-4b-it');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
];
// provide the model with params
const params = {
"temperature": 0
};
// set streaming to "true"
const stream = true;
// send to the model
const readStream = await model.run(input, params, stream);
let text = '';
for await (const tokens of readStream) {
text += tokens;
console.log(tokens);
}
// observe the output
console.log({ text });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("google/gemma-3-4b-it")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
]
# provide the model with params
params = {
"temperature": 0
}
# set streaming to "true"
stream = True
# send to the model
readStream = model.run(input, params, stream)
text = ""
for tokens in readStream:
text += tokens
print(tokens)
# observe the output
print({"text": text})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/google/gemma-3-4b-it' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image"
},
{
"type": "image",
"url": "https://hips.hearstapps.com/hmg-prod/images/how-to-keep-ducks-call-ducks-1615457181.jpg?crop=0.670xw:1.00xh;0.157xw,0&resize=980:*"
}
]
}
],
"params": {
"temperature": 0
},
"stream": true
}'
```
# image-to-text
Source: https://docs.bytez.com/model-api/docs/task/image-to-text
Generate textual descriptions from images for tasks like image captioning, content generation, and accessibility features
For example, ask a model to describe an image
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Salesforce/blip-image-captioning-base');
// provide the model with input
const input = {
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Salesforce/blip-image-captioning-base")
# provide the model with input
input = {
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Salesforce/blip-image-captioning-base' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg"
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# mask-generation
Source: https://docs.bytez.com/model-api/docs/task/mask-generation
Generate masks for objects in images for tasks like image segmentation, medical imaging, and computer vision applications
Send an image to a model to generate object masks
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('facebook/sam-vit-base');
// provide the model with input
const input = {
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/mask-generation/mask-generation-input.png"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("facebook/sam-vit-base")
# provide the model with input
input = {
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/mask-generation/mask-generation-input.png"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/facebook/sam-vit-base' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/mask-generation/mask-generation-input.png"
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# object-detection
Source: https://docs.bytez.com/model-api/docs/task/object-detection
Identify and locate objects in images for applications like security systems, autonomous driving, and retail analytics
Send an image to a model to detect objects and get bounding boxes
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('facebook/detr-resnet-50');
// provide the model with input
const input = {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Cat_November_2010-1a.jpg/1200px-Cat_November_2010-1a.jpg"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("facebook/detr-resnet-50")
# provide the model with input
input = {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Cat_November_2010-1a.jpg/1200px-Cat_November_2010-1a.jpg"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/facebook/detr-resnet-50' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Cat_November_2010-1a.jpg/1200px-Cat_November_2010-1a.jpg"
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# question-answering
Source: https://docs.bytez.com/model-api/docs/task/question-answering
Answer questions based on a given context for applications like customer support, information retrieval, and educational tools
Send a question with context to a model to generate an answer
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('deepset/roberta-base-squad2');
// provide the model with input
const input = {
"question": "Where does Holly live?",
"context": "My name is Holly and I live in NYC"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("deepset/roberta-base-squad2")
# provide the model with input
input = {
"question": "Where does Holly live?",
"context": "My name is Holly and I live in NYC"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/deepset/roberta-base-squad2' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"question": "Where does Holly live?",
"context": "My name is Holly and I live in NYC"
}'
```
# sentence-similarity
Source: https://docs.bytez.com/model-api/docs/task/sentence-similarity
Measure how similar two sentences are for applications like duplicate question detection, paraphrase detection, and text clustering
Send sentences to generate embeddings so you can compare their similarity
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('sentence-transformers/all-MiniLM-L6-v2');
// provide the model with input
const input = "Turn this sentence into a vector";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("sentence-transformers/all-MiniLM-L6-v2")
# provide the model with input
input = "Turn this sentence into a vector"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/sentence-transformers/all-MiniLM-L6-v2' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "Turn this sentence into a vector"
}'
```
# summarization
Source: https://docs.bytez.com/model-api/docs/task/summarization
Summarization involves creating concise summaries of longer texts. Use cases include news summarization, document summarization, and generating abstracts
Generate a summary
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('ainize/bart-base-cnn');
// provide the model with input
const input = "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. It was the first structure to reach a height of 300 metres. Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.";
// provide the model with params
const params = {
"max_length": 40
};
// send to the model
const { error, output } = await model.run(input, params);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("ainize/bart-base-cnn")
# provide the model with input
input = "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. It was the first structure to reach a height of 300 metres. Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct."
# provide the model with params
params = {
"max_length": 40
}
# send to the model
result = model.run(input, params)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/ainize/bart-base-cnn' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. It was the first structure to reach a height of 300 metres. Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.",
"params": {
"max_length": 40
}
}'
```
# text-classification
Source: https://docs.bytez.com/model-api/docs/task/text-classification
Categorize text into predefined classes for applications like sentiment analysis, spam detection, and topic classification
Example, sentiment analysis
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon');
// provide the model with input
const input = "We are furious with the results of the experiment!";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon")
# provide the model with input
input = "We are furious with the results of the experiment!"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "We are furious with the results of the experiment!"
}'
```
# text-generation
Source: https://docs.bytez.com/model-api/docs/task/text-generation
Generate text from an initial prompt for applications like story generation, dialogue systems, and creative writing
Send a prompt to a model to generate text
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('openai-community/gpt2');
// provide the model with input
const input = "Once upon a time there was a beautiful home where";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("openai-community/gpt2")
# provide the model with input
input = "Once upon a time there was a beautiful home where"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/openai-community/gpt2' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "Once upon a time there was a beautiful home where"
}'
```
# text-to-audio
Source: https://docs.bytez.com/model-api/docs/task/text-to-audio
Send a text input to generate an audio output
Send a text input to generate an audio output
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('facebook/musicgen-stereo-small');
// provide the model with input
const input = "Moody jazz music with saxophones";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("facebook/musicgen-stereo-small")
# provide the model with input
input = "Moody jazz music with saxophones"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/facebook/musicgen-stereo-small' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "Moody jazz music with saxophones"
}'
```
# text-to-image
Source: https://docs.bytez.com/model-api/docs/task/text-to-image
Generate images using text
Generate images using text
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('dreamlike-art/dreamlike-photoreal-2.0');
// provide the model with input
const input = "A beautiful landscape with mountains and a river";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("dreamlike-art/dreamlike-photoreal-2.0")
# provide the model with input
input = "A beautiful landscape with mountains and a river"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/dreamlike-art/dreamlike-photoreal-2.0' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "A beautiful landscape with mountains and a river"
}'
```
# text-to-speech
Source: https://docs.bytez.com/model-api/docs/task/text-to-speech
Convert text into natural-sounding speech for applications like virtual assistants, accessibility features, and content creation
Send a text input to generate an audio output
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('suno/bark-small');
// provide the model with input
const input = "Hello, how are you today?";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("suno/bark-small")
# provide the model with input
input = "Hello, how are you today?"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/suno/bark-small' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "Hello, how are you today?"
}'
```
# text-to-video
Source: https://docs.bytez.com/model-api/docs/task/text-to-video
Generate videos from textual descriptions for applications like content creation, entertainment, and education
Send a text prompt to generate a video output
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('ali-vilab/text-to-video-ms-1.7b');
// provide the model with input
const input = "A cat playing with a rose";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("ali-vilab/text-to-video-ms-1.7b")
# provide the model with input
input = "A cat playing with a rose"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/ali-vilab/text-to-video-ms-1.7b' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "A cat playing with a rose"
}'
```
# text2text-generation
Source: https://docs.bytez.com/model-api/docs/task/text2text-generation
Generate text from input text for applications like text completion, content generation, and dialogue systems
Send a prompt to a model to generate text
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('google/flan-t5-base');
// provide the model with input
const input = "Once upon a time there was a beautiful home where";
// provide the model with params
const params = {
"max_new_tokens": 200,
"min_new_tokens": 50,
"temperature": 0.5
};
// send to the model
const { error, output } = await model.run(input, params);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("google/flan-t5-base")
# provide the model with input
input = "Once upon a time there was a beautiful home where"
# provide the model with params
params = {
"max_new_tokens": 200,
"min_new_tokens": 50,
"temperature": 0.5
}
# send to the model
result = model.run(input, params)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/google/flan-t5-base' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "Once upon a time there was a beautiful home where",
"params": {
"max_new_tokens": 200,
"min_new_tokens": 50,
"temperature": 0.5
}
}'
```
# token-classification
Source: https://docs.bytez.com/model-api/docs/task/token-classification
Identify and categorize tokens in text for Named Entity Recognition (NER), Part-of-Speech tagging, and other NLP tasks
Send a text input to classify individual tokens
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('dslim/bert-base-NER');
// provide the model with input
const input = "John Doe is a software engineer at Google";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("dslim/bert-base-NER")
# provide the model with input
input = "John Doe is a software engineer at Google"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/dslim/bert-base-NER' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "John Doe is a software engineer at Google"
}'
```
# translation
Source: https://docs.bytez.com/model-api/docs/task/translation
Translate text from one language to another for multilingual communication, content localization, and language learning
Send a text input to translate it into another language
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Helsinki-NLP/opus-mt-en-zh');
// provide the model with input
const input = "Hello, how are you? Beautiful day today, isn't it?";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Helsinki-NLP/opus-mt-en-zh")
# provide the model with input
input = "Hello, how are you? Beautiful day today, isn't it?"
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Helsinki-NLP/opus-mt-en-zh' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "Hello, how are you? Beautiful day today, isn't it?"
}'
```
# unconditional-image-generation
Source: https://docs.bytez.com/model-api/docs/task/unconditional-image-generation
Randomly generate images without an input
Generate images without specific conditions or inputs for applications in art generation, creative design, and data augmentation
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('afshr/cam_finetune');
// provide the model with input
const input = undefined;
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("afshr/cam_finetune")
# provide the model with input
input = undefined
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/afshr/cam_finetune' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{}'
```
# video-classification
Source: https://docs.bytez.com/model-api/docs/task/video-classification
Categorize videos into predefined classes for applications in video content analysis, security surveillance, and media organization
Send a video input URL to classify its contents
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('ahmedabdo/video-classifier');
// provide the model with input
const input = {
"url": "https://video-previews.elements.envatousercontent.com/6d07b79d-b17a-47b5-9d24-4fe984c7ca36/watermarked_preview/watermarked_preview.mp4"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("ahmedabdo/video-classifier")
# provide the model with input
input = {
"url": "https://video-previews.elements.envatousercontent.com/6d07b79d-b17a-47b5-9d24-4fe984c7ca36/watermarked_preview/watermarked_preview.mp4"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/ahmedabdo/video-classifier' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://video-previews.elements.envatousercontent.com/6d07b79d-b17a-47b5-9d24-4fe984c7ca36/watermarked_preview/watermarked_preview.mp4"
}'
```
You can send the **video** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# Multimodal - Video
Source: https://docs.bytez.com/model-api/docs/task/video-text-to-text
Chat with AI models using text and videos. Also known as video-text-to-text
Send a conversation to a model to generate text from text and audio
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('llava-hf/LLaVA-NeXT-Video-7B-hf');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
];
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("llava-hf/LLaVA-NeXT-Video-7B-hf")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
]
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/llava-hf/LLaVA-NeXT-Video-7B-hf' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
]
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('llava-hf/LLaVA-NeXT-Video-7B-hf');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
];
// provide the model with params
const params = {
"temperature": 0
};
// send to the model
const { error, output } = await model.run(input, params);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("llava-hf/LLaVA-NeXT-Video-7B-hf")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
]
# provide the model with params
params = {
"temperature": 0
}
# send to the model
result = model.run(input, params)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/llava-hf/LLaVA-NeXT-Video-7B-hf' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
],
"params": {
"temperature": 0
}
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('llava-hf/LLaVA-NeXT-Video-7B-hf');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
];
// set streaming to "true"
const stream = true;
// send to the model
const readStream = await model.run(input, stream);
let text = '';
for await (const tokens of readStream) {
text += tokens;
console.log(tokens);
}
// observe the output
console.log({ text });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("llava-hf/LLaVA-NeXT-Video-7B-hf")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
]
# set streaming to "true"
stream = True
# send to the model
readStream = model.run(input, stream=stream)
text = ""
for tokens in readStream:
text += tokens
print(tokens)
# observe the output
print({"text": text})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/llava-hf/LLaVA-NeXT-Video-7B-hf' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
],
"stream": true
}'
```
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('llava-hf/LLaVA-NeXT-Video-7B-hf');
// provide the model with input
const input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
];
// provide the model with params
const params = {
"temperature": 0
};
// set streaming to "true"
const stream = true;
// send to the model
const readStream = await model.run(input, params, stream);
let text = '';
for await (const tokens of readStream) {
text += tokens;
console.log(tokens);
}
// observe the output
console.log({ text });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("llava-hf/LLaVA-NeXT-Video-7B-hf")
# provide the model with input
input = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
]
# provide the model with params
params = {
"temperature": 0
}
# set streaming to "true"
stream = True
# send to the model
readStream = model.run(input, params, stream)
text = ""
for tokens in readStream:
text += tokens
print(tokens)
# observe the output
print({"text": text})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/llava-hf/LLaVA-NeXT-Video-7B-hf' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this video"
},
{
"type": "video",
"url": "https://huggingface.co/datasets/raushan-testing-hf/videos-test/resolve/main/sample_demo_1.mp4"
}
]
}
],
"params": {
"temperature": 0
},
"stream": true
}'
```
# visual-question-answering
Source: https://docs.bytez.com/model-api/docs/task/visual-question-answering
Answer questions based on image content for applications like interactive learning, accessibility features, and content analysis
Send an image URL and a question to receive an answer
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Salesforce/blip-vqa-base');
// provide the model with input
const input = {
"question": "What kind of animal is this?",
"image": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("Salesforce/blip-vqa-base")
# provide the model with input
input = {
"question": "What kind of animal is this?",
"image": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/Salesforce/blip-vqa-base' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"question": "What kind of animal is this?",
"image": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9"
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# zero-shot-classification
Source: https://docs.bytez.com/model-api/docs/task/zero-shot-classification
Classify text into categories not seen during training for applications like intent detection, content moderation, and dynamic classification
Send a text prompt to generate a video output
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('facebook/bart-large-mnli');
// provide the model with input
const input = {
"text": "One day I will see the world",
"candidate_labels": [
"travel",
"cooking",
"dancing"
]
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("facebook/bart-large-mnli")
# provide the model with input
input = {
"text": "One day I will see the world",
"candidate_labels": [
"travel",
"cooking",
"dancing"
]
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/facebook/bart-large-mnli' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"text": "One day I will see the world",
"candidate_labels": [
"travel",
"cooking",
"dancing"
]
}'
```
# zero-shot-image-classification
Source: https://docs.bytez.com/model-api/docs/task/zero-shot-image-classification
Classify images into categories not seen during training for applications like novel object recognition, transfer learning, and few-shot learning
Send an image URL and a set of candidate labels to receive classification results
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('BilelDJ/clip-hugging-face-finetuned');
// provide the model with input
const input = {
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg",
"candidate_labels": [
"squid",
"octopus",
"human",
"cat"
]
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("BilelDJ/clip-hugging-face-finetuned")
# provide the model with input
input = {
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg",
"candidate_labels": [
"squid",
"octopus",
"human",
"cat"
]
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/BilelDJ/clip-hugging-face-finetuned' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://as1.ftcdn.net/v2/jpg/03/03/55/82/1000_F_303558268_YNUQp9NNMTE0X4zrj314mbWcDHd1pZPD.jpg",
"candidate_labels": [
"squid",
"octopus",
"human",
"cat"
]
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# zero-shot-object-detection
Source: https://docs.bytez.com/model-api/docs/task/zero-shot-object-detection
Detect objects in images without prior training on those specific objects. Use cases include novel object detection, transfer learning, and few-shot learning
Send an image URL and a set of candidate labels to detect objects in the image
```javascript javascript theme={null}
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('google/owlv2-base-patch16-finetuned');
// provide the model with input
const input = {
"url": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9",
"candidate_labels": [
"squid",
"octopus",
"human",
"cat"
]
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
```
```python python theme={null}
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("google/owlv2-base-patch16-finetuned")
# provide the model with input
input = {
"url": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9",
"candidate_labels": [
"squid",
"octopus",
"human",
"cat"
]
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
```
```bash http theme={null}
curl -X POST 'https://api.bytez.com/models/v2/google/owlv2-base-patch16-finetuned' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"url": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9",
"candidate_labels": [
"squid",
"octopus",
"human",
"cat"
]
}'
```
You can send the **image** via `url` or `base64` data URL.
We recommend `url` for better performance, as `base64` increases payload size.
# Open vs Closed models
Source: https://docs.bytez.com/model-api/docs/understand-the-api
We handle open & closed models differently
Our API simplifies working with a wide variety of AI models, including both popular closed-source options and flexible open-source alternatives. Although how we handle requests differs behind the scenes depending on the model type, you benefit significantly from our **Unified Model Protocol**.
This protocol means you can use the *same input format* to interact with *any* model on our platform—whether it's open or closed-source. It makes experimenting and switching between models much easier, almost like swapping Lego bricks in your project. This consistency frees you up to focus purely on building your application logic, rather than managing different provider interfaces.
Now, let's dive into the specific ways we handle requests under the hood for open vs. closed models to provide this seamless experience.
Think of us as a smart, multi-lingual translator and secure messenger when you use closed-source models. Our **Unified Model Protocol** means you use **one consistent format** for your requests and receive responses in **one consistent format**, regardless of the underlying provider.
**The Process:**
Your app sends an API request using our standardized input format
We automatically translate your request into the specific format required by
the chosen model provider (e.g., OpenAI, Google Gemini)
We securely pass your request to the model provider's API, using your API
key, so the provider knows it's from you
The provider runs inference on their servers
We receive the provider's raw response and translate to standardized JSON
Your app gets inference results back in standardized JSON
**Key Takeaway:** For closed-source models, we act as a router and standardization layer. You interact with a **single, unified protocol**, making it easy to switch between models providers or use multiple providers without changing your code structure. The inference itself happens on the provider's infrastructure.
When you run an **open‑source** model, Bytez handles all the heavy lifting for you.
When you make a request to our API, this is what we do:
If the model is not immediately available, we spin up a model container on our infrastructure.
When the model is ready for inference, we route your request to the first available instance.
As requests come in, we scale automatically, ensuring that your scaling demands can be met
regardless of the model you choose.
All you need to worry about is specifying a model and making requests to the API, we take care of the rest!
Our goal with open source models is to make them as easy and affordable to use closed source models.
# Welcome
Source: https://docs.bytez.com/model-api/docs/welcome
The unified API for 100,000+ AI models
# What kind of AI are you looking for?
### Popular
Multi-modal models
Text-to-image models
Turn your data to vectors
### Everything