curl --request POST \
--url https://api.promptlayer.com/log-request \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"provider": "<string>",
"model": "<string>",
"input": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [],
"template_format": "f-string",
"type": "completion"
},
"output": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [
"<string>"
],
"template_format": "f-string",
"type": "completion"
},
"request_start_time": "2023-11-07T05:31:56Z",
"request_end_time": "2023-11-07T05:31:56Z",
"parameters": {},
"tags": [],
"metadata": {},
"prompt_name": "<string>",
"prompt_id": 123,
"prompt_version_number": 1,
"prompt_input_variables": {},
"input_tokens": 0,
"output_tokens": 0,
"price": 0,
"function_name": "",
"score": 0
}'
{
"id": 123,
"prompt_version": {
"prompt_template": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [],
"template_format": "f-string",
"type": "completion"
},
"commit_message": "<string>",
"metadata": {
"model": {
"provider": "<string>",
"name": "<string>",
"parameters": {}
},
"customField": "<string>"
}
}
}
curl --request POST \
--url https://api.promptlayer.com/log-request \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"provider": "<string>",
"model": "<string>",
"input": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [],
"template_format": "f-string",
"type": "completion"
},
"output": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [
"<string>"
],
"template_format": "f-string",
"type": "completion"
},
"request_start_time": "2023-11-07T05:31:56Z",
"request_end_time": "2023-11-07T05:31:56Z",
"parameters": {},
"tags": [],
"metadata": {},
"prompt_name": "<string>",
"prompt_id": 123,
"prompt_version_number": 1,
"prompt_input_variables": {},
"input_tokens": 0,
"output_tokens": 0,
"price": 0,
"function_name": "",
"score": 0
}'
{
"id": 123,
"prompt_version": {
"prompt_template": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [],
"template_format": "f-string",
"type": "completion"
},
"commit_message": "<string>",
"metadata": {
"model": {
"provider": "<string>",
"name": "<string>",
"parameters": {}
},
"customField": "<string>"
}
}
}
API key to authorize the operation.
Successful Response
The response is of type object
.
Was this page helpful?