JavaScript
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const response = await client.query.generateCompletion();
console.log(response.completion);curl https://api.morphik.ai/query \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $MORPHIK_API_KEY" \
-d '{}'{
"completion": "<string>",
"usage": {},
"finish_reason": "<string>",
"sources": [],
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}API Reference
Query Completion
Generate completion using relevant chunks as context.
POST
/
query
JavaScript
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const response = await client.query.generateCompletion();
console.log(response.completion);curl https://api.morphik.ai/query \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $MORPHIK_API_KEY" \
-d '{}'{
"completion": "<string>",
"usage": {},
"finish_reason": "<string>",
"sources": [],
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
application/json
Request model for completion generation
Was this page helpful?

