Skip to main content
POST
/
embeddings
Python
from isaacus import Isaacus

client = Isaacus(
    api_key="My API Key",
)
embedding_response = client.embeddings.create(
    model="kanon-2-embedder",
    texts=["Are restraints of trade enforceable under English law?", "What is a non-compete clause?"],
)
print(embedding_response.embeddings)
{
"embeddings": [
{
"index": 0,
"embedding": [
-0.0258,
0.02062,
-0.0114
]
},
{
"index": 1,
"embedding": [
-0.0358,
-0.0128,
0.00251
]
}
],
"usage": {
"input_tokens": 42
}
}

Authorizations

Authorization
string
header
required

An Isaacus-issued API key passed as a bearer token via the Authorization header in the format Authorization: Bearer YOUR_API_KEY.

Body

application/json

A request to embed legal texts with an Isaacus legal AI embedder.

model
string
required

The ID of the model to use for embedding.

Allowed value: "kanon-2-embedder"
Examples:

"kanon-2-embedder"

texts
required

The text or array of texts to embed.

Each text must contain at least one non-whitespace character.

No more than 128 texts can be embedded in a single request.

Examples:
[
"Are restraints of trade enforceable under English law?",
"What is a non-compete clause?"
]
task
enum<string> | null

The task the embeddings will be used for.

retrieval/query is meant for queries and statements, and retrieval/document is meant for anything to be retrieved using query embeddings.

If null, which is the default setting, embeddings will not be optimized for any particular task.

Available options:
retrieval/query,
retrieval/document
Examples:

"retrieval/query"

overflow_strategy
enum<string> | null
default:drop_end

The strategy to employ when content exceeds the model's maximum input length.

drop_end, which is the default setting, drops tokens from the end of the content exceeding the limit.

If null, an error will be raised if any content exceeds the model's maximum input length.

Available options:
drop_end
Examples:

"drop_end"

dimensions
integer | null

The number of dimensions the embeddings should have, not exceeding the maximum dimensions of the model.

If null, the model's default dimensions will be used. A whole number greater than or equal to 1.

Required range: x >= 1
Examples:

1

Response

The content has been successfully embedded.

Embeddings of legal texts produced by an Isaacus legal AI embedder.

embeddings
Content embedding · object[]
required

The embeddings of the inputs.

Examples:
[
{
"index": 0,
"embedding": [-0.0258, 0.02062, -0.0114]
},
{
"index": 1,
"embedding": [-0.0358, -0.0128, 0.00251]
}
]
usage
object
required

Statistics about the usage of resources in the process of embedding the inputs.

Examples:
{ "input_tokens": 42 }
I