Vision
Send images to vision-capable models. Supports both image URLs and base64-encoded data.
Vision requests use the OpenAI content parts format. Instead of passing a plain string for message content, use an array of parts containing text and images. Tributary translates the format automatically for each provider.
Supported image formats
data:image/jpeg;base64,...). Supports JPEG, PNG, GIF, and WebP. Not recommended — base64 encoding increases payload size by ~33% and some providers impose stricter size limits on inline data.
1. Send an image via URL
Pass an image URL in the message content array alongside your text prompt.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.tributary.cc/openai/v1",
apiKey: "<TRIBUTARY_API_KEY>",
});
const response = await client.chat.completions.create({
model: "anthropic:claude-opus-4.6",
messages: [
{
role: "user",
content: [
{ type: "text", text: "What is in this image?" },
{
type: "image_url",
image_url: {
url: "https://example.com/photo.jpg",
},
},
],
},
],
});
console.log(response.choices[0].message.content); 2. Send a base64-encoded image
Encode image data as a base64 data URI. Using URLs is recommended instead — base64 increases payload size and some providers impose stricter limits.
import { readFileSync } from "fs";
const imageBuffer = readFileSync("./photo.jpg");
const base64Image = imageBuffer.toString("base64");
const response = await client.chat.completions.create({
model: "anthropic:claude-opus-4.6",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Describe this image in detail." },
{
type: "image_url",
image_url: {
url: `data:image/jpeg;base64,${base64Image}`,
},
},
],
},
],
});
console.log(response.choices[0].message.content); 3. Send multiple images
Include multiple image parts in a single message to compare or analyze several images at once.
const response = await client.chat.completions.create({
model: "anthropic:claude-opus-4.6",
messages: [
{
role: "user",
content: [
{ type: "text", text: "What are the differences between these two images?" },
{
type: "image_url",
image_url: { url: "https://example.com/photo1.jpg" },
},
{
type: "image_url",
image_url: { url: "https://example.com/photo2.jpg" },
},
],
},
],
});
console.log(response.choices[0].message.content); 1. Send an image via URL
Pass an image URL in the content parts array. No dependencies required.
const response = await fetch(
"https://api.tributary.cc/openai/v1/chat/completions",
{
method: "POST",
headers: {
"Authorization": "Bearer <TRIBUTARY_API_KEY>",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "anthropic:claude-opus-4.6",
messages: [
{
role: "user",
content: [
{ type: "text", text: "What is in this image?" },
{
type: "image_url",
image_url: {
url: "https://example.com/photo.jpg",
},
},
],
},
],
}),
}
);
const data = await response.json();
console.log(data.choices[0].message.content); 2. Send a base64-encoded image
Encode image data as a base64 data URI. Using URLs is recommended instead — base64 increases payload size and some providers impose stricter limits.
import { readFileSync } from "fs";
const imageBuffer = readFileSync("./photo.jpg");
const base64Image = imageBuffer.toString("base64");
const response = await fetch(
"https://api.tributary.cc/openai/v1/chat/completions",
{
method: "POST",
headers: {
"Authorization": "Bearer <TRIBUTARY_API_KEY>",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "anthropic:claude-opus-4.6",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Describe this image in detail." },
{
type: "image_url",
image_url: {
url: `data:image/jpeg;base64,${base64Image}`,
},
},
],
},
],
}),
}
);
const data = await response.json();
console.log(data.choices[0].message.content); 1. Send an image via URL
Pass an image URL in the message content array alongside your text prompt.
from openai import OpenAI
client = OpenAI(
base_url="https://api.tributary.cc/openai/v1",
api_key="<TRIBUTARY_API_KEY>",
)
response = client.chat.completions.create(
model="anthropic:claude-opus-4.6",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/photo.jpg",
},
},
],
},
],
)
print(response.choices[0].message.content) 2. Send a base64-encoded image
Encode image data as a base64 data URI. Using URLs is recommended instead — base64 increases payload size and some providers impose stricter limits.
import base64
with open("./photo.jpg", "rb") as f:
base64_image = base64.b64encode(f.read()).decode("utf-8")
response = client.chat.completions.create(
model="anthropic:claude-opus-4.6",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image in detail."},
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}",
},
},
],
},
],
)
print(response.choices[0].message.content) 3. Send multiple images
Include multiple image parts in a single message to compare or analyze several images at once.
response = client.chat.completions.create(
model="anthropic:claude-opus-4.6",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "What are the differences between these two images?"},
{
"type": "image_url",
"image_url": {"url": "https://example.com/photo1.jpg"},
},
{
"type": "image_url",
"image_url": {"url": "https://example.com/photo2.jpg"},
},
],
},
],
)
print(response.choices[0].message.content) 1. Send an image via URL
Pass an image URL in the content parts array using the requests library.
import requests
response = requests.post(
"https://api.tributary.cc/openai/v1/chat/completions",
headers={
"Authorization": "Bearer <TRIBUTARY_API_KEY>",
"Content-Type": "application/json",
},
json={
"model": "anthropic:claude-opus-4.6",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/photo.jpg",
},
},
],
},
],
},
)
print(response.json()["choices"][0]["message"]["content"]) 2. Send a base64-encoded image
Encode image data as a base64 data URI. Using URLs is recommended instead — base64 increases payload size and some providers impose stricter limits.
import requests
import base64
with open("./photo.jpg", "rb") as f:
base64_image = base64.b64encode(f.read()).decode("utf-8")
response = requests.post(
"https://api.tributary.cc/openai/v1/chat/completions",
headers={
"Authorization": "Bearer <TRIBUTARY_API_KEY>",
"Content-Type": "application/json",
},
json={
"model": "anthropic:claude-opus-4.6",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image in detail."},
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}",
},
},
],
},
],
},
)
print(response.json()["choices"][0]["message"]["content"]) 1. Send an image via URL
Pass an image URL in the content parts array from the command line.
curl https://api.tributary.cc/openai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TRIBUTARY_API_KEY" \
-d '{
"model": "anthropic:claude-opus-4.6",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/photo.jpg"
}
}
]
}
]
}' 2. Send a base64-encoded image
Encode a local image as base64 and include it as a data URI. Using URLs is recommended instead — base64 increases payload size and some providers impose stricter limits.
# Encode a local image as base64
BASE64_IMAGE=$(base64 -i ./photo.jpg)
curl https://api.tributary.cc/openai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TRIBUTARY_API_KEY" \
-d '{
"model": "anthropic:claude-opus-4.6",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image in detail."},
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,'"$BASE64_IMAGE"'"
}
}
]
}
]
}'