Python
TypeScript
ComputeText( prompt="Who is Don Quixote?", temperature=0.4, max_tokens=800,)
Output
{ "text": "Don Quixote is a fictional character in the novel of the same name by Miguel de Cervantes."}
Compute text using a language model.
prompt
string
Input prompt.
Image prompts.
Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.
0.4
Maximum number of tokens to generate.
Selected model. Firellava13B
is automatically selected when image_uris
is provided.
Mixtral8x7BInstruct
Llama3Instruct8B
Llama3Instruct70B
Llama3Instruct405B
Firellava13B
gpt-4o
gpt-4o-mini
claude-3-5-sonnet-20240620
Llama3Instruct8B
Generate multiple text choices using a language model.
prompt
string
Input prompt.
num_choices
integer[1..8]
Number of choices to generate.
1
Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.
0.4
Maximum number of tokens to generate.
Selected model.
Mixtral8x7BInstruct
Llama3Instruct8B
Llama3Instruct70B
Llama3Instruct8B
Compute text for multiple prompts in batch using a language model.
prompts
array[string]
Batch input prompts.
Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.
0.4
Maximum number of tokens to generate.
Selected model.
Llama3Instruct8B
Compute JSON using a language model.
prompt
string
Input prompt.
json_schema
object
JSON schema to guide json_object
response.
Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.
0.4
Maximum number of tokens to generate.
Selected model.
Mixtral8x7BInstruct
Llama3Instruct8B
Llama3Instruct70B
gpt-4o
Llama3Instruct8B
Compute multiple JSON choices using a language model.
prompt
string
Input prompt.
json_schema
object
JSON schema to guide json_object
response.
num_choices
integer[1..8]
Number of choices to generate.
2
Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.
0.4
Maximum number of tokens to generate.
Selected model.
Mixtral8x7BInstruct
Llama3Instruct8B
Llama3Instruct8B
Compute JSON for multiple prompts in batch using a language model.
prompts
array[string]
Batch input prompts.
json_schema
object
JSON schema to guide json_object
response.
Sampling temperature to use. Higher values make the output more random, lower values make the output more deterministic.
0.4
Maximum number of tokens to generate.
Selected model.
Llama3Instruct8B
Compute text using Mistral 7B Instruct.
prompt
string
Input prompt.
System prompt.
Number of choices to generate.
1
JSON schema to guide response.
Higher values make the output more random, lower values make the output more deterministic.
Higher values decrease the likelihood of repeating previous tokens.
0
Higher values decrease the likelihood of repeated sequences.
1
Higher values increase the likelihood of new topics appearing.
1.1
Probability below which less likely tokens are filtered out.
0.95
Maximum number of tokens to generate.
Compute text using instruct-tuned Mixtral 8x7B.
prompt
string
Input prompt.
System prompt.
Number of choices to generate.
1
JSON schema to guide response.
Higher values make the output more random, lower values make the output more deterministic.
Higher values decrease the likelihood of repeating previous tokens.
0
Higher values decrease the likelihood of repeated sequences.
1
Higher values increase the likelihood of new topics appearing.
1.1
Probability below which less likely tokens are filtered out.
0.95
Maximum number of tokens to generate.
Compute text using instruct-tuned Llama 3 8B.
prompt
string
Input prompt.
System prompt.
Number of choices to generate.
1
Higher values make the output more random, lower values make the output more deterministic.
Higher values decrease the likelihood of repeating previous tokens.
0
Higher values decrease the likelihood of repeated sequences.
1
Higher values increase the likelihood of new topics appearing.
1.1
Probability below which less likely tokens are filtered out.
0.95
Maximum number of tokens to generate.
JSON schema to guide response.
Compute text using instruct-tuned Llama 3 70B.
prompt
string
Input prompt.
System prompt.
Number of choices to generate.
1
Higher values make the output more random, lower values make the output more deterministic.
Higher values decrease the likelihood of repeating previous tokens.
0
Higher values decrease the likelihood of repeated sequences.
1
Higher values increase the likelihood of new topics appearing.
1.1
Probability below which less likely tokens are filtered out.
0.95
Maximum number of tokens to generate.
Compute text with image input using FireLLaVA 13B.
Generate an image.
prompt
string
Text prompt.
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Generate multiple images.
prompt
string
Text prompt.
num_images
integer[1..8]
Number of images to generate.
2
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Edit an image using image generation inside part of the image or the full image.
image_uri
string
Original image.
prompt
string
Text prompt.
Mask image that controls which pixels are inpainted. If unset, the entire image is edited (image-to-image).
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Edit multiple images using image generation.
image_uri
string
Original image.
prompt
string
Text prompt.
Mask image that controls which pixels are edited (inpainting). If unset, the entire image is edited (image-to-image).
num_images
integer[1..8]
Number of images to generate.
2
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Upscale an image using image generation.
Prompt to guide model on the content of image to upscale.
image_uri
string
Input image.
Resolution of the output image, in pixels.
1024
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Erase the masked part of an image, e.g. to remove an object by inpainting.
image_uri
string
Input image.
mask_image_uri
string
Mask image that controls which pixels are inpainted.
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Generates a interpolation frames between each adjacent frames.
frame_uris
array[string]
Frames.
Use "hosted" to return a video URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the video data will be returned as a base64-encoded string.
Output video format.
gif
webp
mp4
frames
gif
Frames per second of the generated video. Ignored if output format is frames
.
7
Number of interpolation steps. Each step adds an interpolated frame between adjacent frames. For example, 2 steps over 2 frames produces 5 frames.
2
Generate an image using Stable Diffusion XL Lightning.
prompt
string
Text prompt.
Negative input prompt.
Number of images to generate.
1
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Height of output image, in pixels.
1024
Width of output image, in pixels.
1024
Seeds for deterministic generation. Default is a random seed.
Edit an image using Stable Diffusion XL. Supports inpainting (edit part of the image with a mask) and image-to-image (edit the full image).
image_uri
string
Original image.
prompt
string
Text prompt.
Mask image that controls which pixels are edited (inpainting). If unset, the entire image is edited (image-to-image).
num_images
integer[1..8]
Number of images to generate.
1
Resolution of the output image, in pixels.
1024
Negative input prompt.
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Controls the strength of the generation process.
0.8
Random noise seeds. Default is random seeds for each generation.
Generate an image with generation structured by an input image, using Stable Diffusion XL with ControlNet.
image_uri
string
Input image.
control_method
string
Strategy to control generation using the input image.
edge
depth
illusion
tile
prompt
string
Text prompt.
num_images
integer[1..8]
Number of images to generate.
1
Resolution of the output image, in pixels.
1024
Negative input prompt.
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Controls the influence of the input image on the generated output.
0.5
Controls how much to transform the input image.
0.5
Random noise seeds. Default is random seeds for each generation.
Generates a video using a still image as conditioning frame.
image_uri
string
Original image.
Use "hosted" to return a video URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the video data will be returned as a base64-encoded string.
Output video format.
gif
webp
mp4
frames
gif
Seed for deterministic generation. Default is a random seed.
Frames per second of the generated video. Ignored if output format is frames
.
7
The motion bucket id to use for the generated video. This can be used to control the motion of the generated video. Increasing the motion bucket id increases the motion of the generated video.
180
The amount of noise added to the conditioning image. The higher the values the less the video resembles the conditioning image. Increasing this value also increases the motion of the generated video.
0.1
Remove the background from an image and return the foreground segment as a cut-out or a mask.
image_uri
string
Input image.
Return a mask image instead of the original content.
false
Invert the mask image. Only takes effect if return_mask
is true.
false
Hex value background color. Transparent if unset.
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Segment an image under a point and return the segment.
image_uri
string
Input image.
point
Point
Point prompt.
x
integer
X position.
y
integer
Y position.
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Segment an image using SegmentAnything.
image_uri
string
Input image.
Point prompts, to detect a segment under the point. One of point_prompts
or box_prompts
must be set.
x
integer
X position.
y
integer
Y position.
Box prompts, to detect a segment within the bounding box. One of point_prompts
or box_prompts
must be set.
x1
float
Top left corner x.
y1
float
Top left corner y.
x2
float
Bottom right corner x.
y2
float
Bottom right corner y.
Use "hosted" to return an image URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the image data will be returned as a base64-encoded string.
Split document into text segments.
uri
string
URI of the document.
Document ID.
Document metadata.
Maximum number of units per chunk. Defaults to 1024 tokens for text or 40 lines for code.
Number of units to overlap between chunks. Defaults to 200 tokens for text or 15 lines for code.
Generate embedding for a text document.
text
string
Text to embed.
Vector store name.
Metadata that can be used to query the vector store. Ignored if collection_name
is unset.
Choose keys from metadata
to embed with text.
Vector store document ID. Ignored if store
is unset.
Selected embedding model.
jina-v2
clip
jina-v2
Generate embeddings for multiple text documents.
items
array[EmbedTextItem]
Items to embed.
text
string
Text to embed.
metadata
object
Metadata that can be used to query the vector store. Ignored if collection_name
is unset.
doc_id
string
Vector store document ID. Ignored if collection_name
is unset.
Vector store name.
Choose keys from metadata
to embed with text.
Selected embedding model.
jina-v2
clip
jina-v2
Generate embedding for an image.
image_uri
string
Image to embed.
Vector store name.
Vector store document ID. Ignored if collection_name
is unset.
Selected embedding model.
clip
Generate embeddings for multiple images.
items
array[EmbedImageItem]
Items to embed.
image_uri
string
Image to embed.
doc_id
string
Vector store document ID. Ignored if collection_name
is unset.
Vector store name.
Selected embedding model.
clip
Generate embeddings for multiple text documents using Jina Embeddings 2.
items
array[EmbedTextItem]
Items to embed.
text
string
Text to embed.
metadata
object
Metadata that can be used to query the vector store. Ignored if collection_name
is unset.
doc_id
string
Vector store document ID. Ignored if collection_name
is unset.
Vector store name.
Choose keys from metadata
to embed with text.
Generate embeddings for text or images using CLIP.
items
array[EmbedTextOrImageItem]
Items to embed.
image_uri
string
Image to embed.
text
string
Text to embed.
metadata
object
Metadata that can be used to query the vector store. Ignored if collection_name
is unset.
doc_id
string
Vector store document ID. Ignored if collection_name
is unset.
Vector store name.
Choose keys from metadata
to embed with text. Only applies to text items.
Find a vector store matching the given collection name, or create a new vector store.
collection_name
string
Vector store name.
model
string
Selected embedding model.
jina-v2
clip
Delete a vector store.
collection_name
string
Vector store name.
model
string
Selected embedding model.
jina-v2
clip
Query a vector store for similar vectors.
collection_name
string
Vector store to query against.
model
string
Selected embedding model.
jina-v2
clip
Texts to embed and use for the query.
Image URIs to embed and use for the query.
Vectors to use for the query.
Document IDs to use for the query.
Number of results to return.
10
The size of the dynamic candidate list for searching the index graph.
40
The number of leaves in the index tree to search.
40
Include the values of the vectors in the response.
false
Include the metadata of the vectors in the response.
false
Filter metadata by key-value pairs.
Fetch vectors from a vector store.
collection_name
string
Vector store name.
model
string
Selected embedding model.
jina-v2
clip
ids
array[string]
Document IDs to retrieve.
Update vectors in a vector store.
collection_name
string
Vector store name.
model
string
Selected embedding model.
jina-v2
clip
vectors
array[UpdateVectorParams]
Vectors to upsert.
id
string
Document ID.
vector
array[number]
Embedding vector.
metadata
object
Document metadata.
Delete vectors in a vector store.
collection_name
string
Vector store name.
model
string
Selected embedding model.
jina-v2
clip
ids
array[string]
Document IDs to delete.
Transcribe speech in an audio or video file.
audio_uri
string
Input audio.
Prompt to guide model on the content and context of input audio.
(Deprecated) Segment the text into sentences with approximate timestamps.
false
Align transcription to produce more accurate sentence-level timestamps and word-level timestamps. An array of word segments will be included in each sentence segment.
false
Identify speakers for each segment. Speaker IDs will be included in each segment.
false
Suggest automatic chapter markers.
false
Generate speech from text.
text
string
Input text.
Use "hosted" to return an audio URL hosted on Substrate. You can also provide a URL to a registered file store. If unset, the audio data will be returned as a base64-encoded string.
Return one of two options based on a condition.