Enrich entity
curl --request POST \
--url https://app.lev8.com/v1/enrich \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_context": "Company: OpenAI\nWebsite: https://openai.com",
"enrich_fields": {
"type": "object",
"properties": {
"company_summary": {
"type": "string"
},
"ceo": {
"type": "string"
}
},
"required": [
"company_summary",
"ceo"
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entity_context: 'Company: OpenAI\nWebsite: https://openai.com',
enrich_fields: {
type: 'object',
properties: {company_summary: {type: 'string'}, ceo: {type: 'string'}},
required: ['company_summary', 'ceo']
}
})
};
fetch('https://app.lev8.com/v1/enrich', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.lev8.com/v1/enrich"
payload = {
"entity_context": "Company: OpenAI
Website: https://openai.com",
"enrich_fields": {
"type": "object",
"properties": {
"company_summary": { "type": "string" },
"ceo": { "type": "string" }
},
"required": ["company_summary", "ceo"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"answer": {
"company_summary": "OpenAI is an AI research and product company.",
"ceo": "Sam Altman"
}
}Enrich
Enrich entity
Generate structured fields for an entity from context and a JSON Schema.
POST
/
v1
/
enrich
Enrich entity
curl --request POST \
--url https://app.lev8.com/v1/enrich \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity_context": "Company: OpenAI\nWebsite: https://openai.com",
"enrich_fields": {
"type": "object",
"properties": {
"company_summary": {
"type": "string"
},
"ceo": {
"type": "string"
}
},
"required": [
"company_summary",
"ceo"
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entity_context: 'Company: OpenAI\nWebsite: https://openai.com',
enrich_fields: {
type: 'object',
properties: {company_summary: {type: 'string'}, ceo: {type: 'string'}},
required: ['company_summary', 'ceo']
}
})
};
fetch('https://app.lev8.com/v1/enrich', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.lev8.com/v1/enrich"
payload = {
"entity_context": "Company: OpenAI
Website: https://openai.com",
"enrich_fields": {
"type": "object",
"properties": {
"company_summary": { "type": "string" },
"ceo": { "type": "string" }
},
"required": ["company_summary", "ceo"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"answer": {
"company_summary": "OpenAI is an AI research and product company.",
"ceo": "Sam Altman"
}
}Submits entity context and a JSON Schema. The response returns enrichment data that follows the requested schema when possible.
The root schema must have
If the workflow completes without a generated result, the response can use
type: "object" and at least one entry in properties. Lev8 accepts schemas up to 256 KiB, 12 levels, and 200 cumulative properties.
Example
curl "https://app.lev8.com/v1/enrich" \
--request POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $LEV8_API_KEY" \
--data '{
"entity_context": "Company: OpenAI\nWebsite: https://openai.com",
"enrich_fields": {
"type": "object",
"properties": {
"company_summary": {"type": "string"},
"ceo": {"type": "string"}
},
"required": ["company_summary", "ceo"]
}
}'
Response
{
"success": true,
"answer": {
"company_summary": "OpenAI is an AI research and product company.",
"ceo": "Sam Altman"
}
}
success: false:
{
"success": false,
"answer": {
"answer": "No result generated from enrich"
}
}
Generate fields with Pydantic
from pydantic import BaseModel, Field
class CompanyEnrichFields(BaseModel):
company_summary: str = Field(description="Company summary")
ceo: str = Field(description="Current CEO")
entity_context = "Company: OpenAI\nWebsite: https://openai.com"
enrich_fields = CompanyEnrichFields.model_json_schema()
payload = {
"entity_context": entity_context,
"enrich_fields": enrich_fields,
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional stable key for this logical request. When omitted, lev8 generates one and returns it in the response Header.
Maximum string length:
128Body
application/json
Context for the entity to enrich, such as name, website, social handles, or an existing description. Maximum 16 KiB after trimming.
Minimum string length:
1Example:
"Company: OpenAI\nWebsite: https://openai.com"
Object JSON Schema that describes the fields to generate. Maximum 256 KiB, 12 levels, and 200 cumulative properties.
Show child attributes
Show child attributes
Example:
{
"type": "object",
"properties": {
"company_summary": { "type": "string" },
"ceo": { "type": "string" }
},
"required": ["company_summary", "ceo"]
}