Embeddings API
curl --request POST \
--url https://api.opper.ai/v3/compat/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<unknown>",
"model": "<string>"
}
'import requests
url = "https://api.opper.ai/v3/compat/embeddings"
payload = {
"input": "<unknown>",
"model": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<unknown>', model: '<string>'})
};
fetch('https://api.opper.ai/v3/compat/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"embedding": [
123
],
"index": 123,
"object": "<string>"
}
],
"model": "<string>",
"object": "<string>",
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}OpenAI
Embeddings
OpenAI-compatible embeddings endpoint.
POST
/
v3
/
compat
/
embeddings
Embeddings API
curl --request POST \
--url https://api.opper.ai/v3/compat/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<unknown>",
"model": "<string>"
}
'import requests
url = "https://api.opper.ai/v3/compat/embeddings"
payload = {
"input": "<unknown>",
"model": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<unknown>', model: '<string>'})
};
fetch('https://api.opper.ai/v3/compat/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"embedding": [
123
],
"index": 123,
"object": "<string>"
}
],
"model": "<string>",
"object": "<string>",
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Authorizations
API key authentication. Pass your API key as a Bearer token.
Headers
Function name for tracing and project-level guardrail function-scope filtering.
Parent span ID for distributed tracing context.
Comma-separated key:value usage-attribution tags (e.g. tenant:acme,project:demo, max 8). Recorded on the generation's billing/metrics rows; group spend by any key via GET /v2/analytics/usage?group_by=. Header-borne twin of the /v3/session URL prefix tags (which win per key when both are present); opper.-prefixed keys and session_id are reserved. Malformed values return 400.
Body
application/json