JavaScript
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const logs = await client.logs.list();
console.log(logs);curl https://api.morphik.ai/logs/ \
-H "Authorization: Bearer $MORPHIK_API_KEY"[
{
"timestamp": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"operation_type": "<string>",
"status": "<string>",
"tokens_used": 123,
"duration_ms": 123,
"app_id": "<string>",
"metadata": {},
"error": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Logs
Get Logs
Return recent logs for the authenticated user (scoped by app_id).
Args:
hours: Number of hours of history to retrieve (default 4)
- <= 4 hours: reads from local files
- > 4 hours: queries logs.morphik.ai proxy (requires proxy endpoint)
GET
/
logs
/
JavaScript
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const logs = await client.logs.list();
console.log(logs);curl https://api.morphik.ai/logs/ \
-H "Authorization: Bearer $MORPHIK_API_KEY"[
{
"timestamp": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"operation_type": "<string>",
"status": "<string>",
"tokens_used": 123,
"duration_ms": 123,
"app_id": "<string>",
"metadata": {},
"error": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Headers
Query Parameters
Required range:
1 <= x <= 500Required range:
0.1 <= x <= 168Was this page helpful?

