Get the latest version
curl --request GET \
--url https://api.lunary.ai/v1/template-versions/latest \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"templateId": "<string>",
"content": [
{
"role": "<string>",
"content": "<string>"
}
],
"extra": {},
"testValues": {},
"isDraft": true,
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"version": 123
}Templates
Get the latest version
This is the most common endpoint you’ll use when working with prompt templates.
This route is used by the Lunary SDKs to fetch the latest version of a template before making an LLM call.
This route differs from all the next ones in that:
- it requires only the
slugparameter to reference a template - it doesn’t require using a Private Key to authenticate the request (Public Key is enough)
GET
/
v1
/
template-versions
/
latest
Get the latest version
curl --request GET \
--url https://api.lunary.ai/v1/template-versions/latest \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"templateId": "<string>",
"content": [
{
"role": "<string>",
"content": "<string>"
}
],
"extra": {},
"testValues": {},
"isDraft": true,
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"version": 123
}Authorizations
Use a project public API key via Authorization: Bearer <key>.
Query Parameters
Slug of the template