Skip to main content
POST
Model Selection
Example usage:

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
messages
object[]
required

The messages array in OpenAI format.

llm_providers
object[]
required

A list of LLM providers you want to route between. You can optionally define their custom attributes, such as price and latency.

tools
object[]

A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.

max_model_depth
integer<int32>

The maximum depth considered in the ranked LLM providers list.

tradeoff
string

Additional routing tradeoffs. Valid values are "cost" and "latency".

preference_id
string

The preference ID created on the Not Diamond dashboard. Setting this value will change the ranking algorithm based on the preferences set.

hash_content
boolean
default:false

Whether to hash the content of messages.

previous_session
string

The session ID from a previous API call. This allows you to link recommendations such that the recommendation engine knows which requests belong in the same group.

Response

Successful response

llm_label
string
required

Label of the LLM you should call.