Add and manage metadata and tags for logs
metadata
field to the request with the metadata you want to attach to the log.
language:en
, task:summarize
, domain:programming
, subscription_tier:pro
.
Additionaly, any metadata keys with null values will just be added as a tag without a value (e.g. {"test": null}
will generate the tag test
).
task
: The task the request is for (e.g. summarization, translation, etc.) if your application uses multiple tasks. These should roughly corrospond to the different prompt templates you use.language
: The language of the request content (if you support multiple languages).domain
: The domain of the request content (e.g. programming, finance, etc.) if you support multiple domains.subscription_tier
: The subscription tier of the user making the request (e.g. free, pro, enterprise) if you have different tiers of service - this can be useful for routing requests to different models based on the user’s subscription level.PATCH /log/:log_id
endpoint with the metadata
or metadata_tags
field set to the metadata or tags you want to add.
Note that when updating metadata via the API, the new metadata will replace the existing metadata on the log. If you want to add to the existing metadata, you should include all the existing metadata in the request.
Additionally, updating the metadata via the API does not affect the tags generated from the metadata. The tags are generated when the log is created and are not updated when the metadata is updated. If you want to update the tags, you should update the metadata_tags
field.