Create a new Context Item

Creates a new context item. The context items are indexed for appending into related prompts using the with-context endpoint.

You can optionally add references and types to the context item.

Path Params
string
required

ID of project

Query Params
number

The maximum amount of tokens for the context item. If the context item exceeds this amount, it will fail unless include the exceedTokensStrategy to specify the result. Defaults to 800.

string
enum

How to handle context items that exceed the maxTokens. Defaults to 'fail'. fail will return an error, split will split the context item into multiple context items with none larger than the maxTokens, and truncate will truncate the context item to the maxTokens.

Allowed:
Body Params
string
required

The string you want to index as a Context Item

string

The ID of the Context Item. Will be autogenerated if not provided. Useful for mapping to your own IDs from databases or other systems.

string

A reference url you want to filter by or link to in the future

string

The type of the Context Item. This is used to filter by in the future.

tags
array of strings
tags
Response

Language
Credentials
Bearer
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json