import requests
url = "https://api.memic.ai/api/v1/chat"
payload = {
"question": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"connector_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"top_k": 5,
"min_score": 0.2
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.memic.ai/api/v1/chat \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"connector_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"top_k": 5,
"min_score": 0.2
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question: '<string>',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
file_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
connector_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
top_k: 5,
min_score: 0.2
})
};
fetch('https://api.memic.ai/api/v1/chat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"question": "<string>",
"answer": "<string>",
"search_time_ms": 123,
"generation_time_ms": 123,
"model": "<string>",
"citations": [],
"total_chunks_used": 0,
"routing": {
"route": "<string>",
"reasoning": "<string>",
"connector_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connector_name": "<string>",
"sql_generated": "<string>",
"sql_explanation": "<string>"
},
"results": {
"semantic": [],
"structured": {
"columns": [],
"rows": []
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Chat with documents
Grounded question-answering over the indexed documents in your environment. Returns an answer plus structured citations back to the source files.
import requests
url = "https://api.memic.ai/api/v1/chat"
payload = {
"question": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"connector_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"top_k": 5,
"min_score": 0.2
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.memic.ai/api/v1/chat \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"connector_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"top_k": 5,
"min_score": 0.2
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question: '<string>',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
file_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
connector_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
top_k: 5,
min_score: 0.2
})
};
fetch('https://api.memic.ai/api/v1/chat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"question": "<string>",
"answer": "<string>",
"search_time_ms": 123,
"generation_time_ms": 123,
"model": "<string>",
"citations": [],
"total_chunks_used": 0,
"routing": {
"route": "<string>",
"reasoning": "<string>",
"connector_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connector_name": "<string>",
"sql_generated": "<string>",
"sql_explanation": "<string>"
},
"results": {
"semantic": [],
"structured": {
"columns": [],
"rows": []
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Memic API key. Every key is bound to exactly one environment — get one from the Memic dashboard under API Keys.
Body
Request for chat/answer generation with intelligent routing.
User question
1 - 1000Optional project filter for semantic search
Optional file filter for semantic search
Optional connector ID for structured queries
Force a specific route (structured/semantic/hybrid)
structured, semantic, hybrid Number of chunks to retrieve
1 <= x <= 20Minimum similarity score
0 <= x <= 1Response
Successful Response
Response with LLM-generated answer, citations, and routing info.
Show child attributes
Show child attributes
How the query was routed
Show child attributes
Show child attributes
Search results (semantic and/or structured) - same structure as SearchResponse
Show child attributes
Show child attributes