mistralM

Docs

sideBar

Beta Prompts

(beta) Prompts API.

GET /v2/prompts

ListPrompts

ListPrompts

Parameters

pageSize
int32query
pageToken
stringquery
alias
stringquery
fields
array<string>query
sort.field
"list_sort_field_unspecified" | "list_sort_field_created_at" | "list_sort_field_last_modified_at" | "list_sort_field_name" | "list_sort_field_title"query

Defaults to created_at when omitted.

sort.direction
"list_sort_direction_unspecified" | "list_sort_direction_asc" | "list_sort_direction_desc"query

Defaults to descending for timestamp fields and ascending for text fields.

sort_by
stringquery

REST-friendly alias for sort.field. Supported values: created_at, last_modified_at, name, title.

sort_direction
stringquery

REST-friendly alias for sort.direction. Supported values: asc, desc.

Responses

Success

data
array<Prompt>
Prompt
aliases
array<string>

Aliases pointing to this version.

createdAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
createdBy
string

Versioned prompt content.

PromptDefinition

Versioned prompt content.

content
string* required

Prompt template content.

variables
array<PromptVariable>

Variables used by the prompt.

PromptVariable
name
string

Stable object name.

description
string

Display description.

id
string
latestVersion
int32

Latest version number.

Example:

1
name
string

Stable object name.

notes
string

Notes for this version.

sharingScope
"sharing_scope_unspecified" | "private" | "workspace"
title
string

Display title.

updatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
version
int32

Example:

1
versionCreatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
nextPageToken
string

POST /v2/prompts

CreatePrompt

CreatePrompt

Request Example

{
  "definition": {
    "content": "ipsum eiusmod"
  },
  "name": "consequat do"
}

Request Body

aliases
array<string>

Aliases pointing to this version.

definition
PromptDefinition* required

Versioned prompt content.

PromptDefinition

Versioned prompt content.

content
string* required

Prompt template content.

variables
array<PromptVariable>

Variables used by the prompt.

PromptVariable
name
string

Stable object name.

description
string | null

Display description.

name
string* required

Stable object name.

notes
string | null

Notes for this version.

sharingScope
"sharing_scope_unspecified" | "private" | "workspace"
title
string | null

Display title.

workspaceRelation
"share_relation_unspecified" | "reader" | "writer"

Relation a subject holds on a shared registry object.

Responses

Success

aliases
array<string>

Aliases pointing to this version.

createdAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
createdBy
string

Versioned prompt content.

PromptDefinition

Versioned prompt content.

content
string* required

Prompt template content.

variables
array<PromptVariable>

Variables used by the prompt.

PromptVariable
name
string

Stable object name.

description
string

Display description.

id
string
latestVersion
int32

Latest version number.

Example:

1
name
string

Stable object name.

notes
string

Notes for this version.

sharingScope
"sharing_scope_unspecified" | "private" | "workspace"
title
string

Display title.

updatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
version
int32

Example:

1
versionCreatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s

GET /v2/prompts/{prompt_id}

GetPrompt

GetPrompt

Parameters

prompt_id
stringpath* required
version
int32query
alias
stringquery
fields
array<string>query

Responses

Success

aliases
array<string>

Aliases pointing to this version.

createdAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
createdBy
string

Versioned prompt content.

PromptDefinition

Versioned prompt content.

content
string* required

Prompt template content.

variables
array<PromptVariable>

Variables used by the prompt.

PromptVariable
name
string

Stable object name.

description
string

Display description.

id
string
latestVersion
int32

Latest version number.

Example:

1
name
string

Stable object name.

notes
string

Notes for this version.

sharingScope
"sharing_scope_unspecified" | "private" | "workspace"
title
string

Display title.

updatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
version
int32

Example:

1
versionCreatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s

DELETE /v2/prompts/{prompt_id}

DeletePrompt

DeletePrompt

Parameters

prompt_id
stringpath* required

Responses

Success

PATCH /v2/prompts/{prompt_id}

UpdatePrompt

UpdatePrompt

Parameters

prompt_id
stringpath* required

Request Example

{}

Request Body

description
string | null

Display description.

sharingScope
"sharing_scope_unspecified" | "private" | "workspace"
title
string | null

Display title.

workspaceRelation
"share_relation_unspecified" | "reader" | "writer"

Relation a subject holds on a shared registry object.

Responses

Success

aliases
array<string>

Aliases pointing to this version.

createdAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
createdBy
string

Versioned prompt content.

PromptDefinition

Versioned prompt content.

content
string* required

Prompt template content.

variables
array<PromptVariable>

Variables used by the prompt.

PromptVariable
name
string

Stable object name.

description
string

Display description.

id
string
latestVersion
int32

Latest version number.

Example:

1
name
string

Stable object name.

notes
string

Notes for this version.

sharingScope
"sharing_scope_unspecified" | "private" | "workspace"
title
string

Display title.

updatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
version
int32

Example:

1
versionCreatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s

GET /v2/prompts/{prompt_id}/versions

ListPromptVersions

ListPromptVersions

Parameters

prompt_id
stringpath* required

Responses

Success

data
array<PromptVersion>
PromptVersion
aliases
array<string>

Aliases pointing to this version.

createdAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s

Versioned prompt content.

PromptDefinition

Versioned prompt content.

content
string* required

Prompt template content.

variables
array<PromptVariable>

Variables used by the prompt.

PromptVariable
name
string

Stable object name.

notes
string

Notes for this version.

version
int32

Example:

1

POST /v2/prompts/{prompt_id}/versions

CreatePromptVersion

CreatePromptVersion

Parameters

prompt_id
stringpath* required

Request Example

{
  "definition": {
    "content": "ipsum eiusmod"
  }
}

Request Body

aliases
array<string>

Aliases pointing to this version.

definition
PromptDefinition* required

Versioned prompt content.

PromptDefinition

Versioned prompt content.

content
string* required

Prompt template content.

variables
array<PromptVariable>

Variables used by the prompt.

PromptVariable
name
string

Stable object name.

notes
string | null

Notes for this version.

Responses

Success

deduplicated
boolean

Example:

false
version
int32

Example:

1

GET /v2/prompts/{prompt_id}/versions/{version}

GetPromptVersion

GetPromptVersion

Parameters

prompt_id
stringpath* required
version
int32path* required
fields
array<string>query

Responses

Success

aliases
array<string>

Aliases pointing to this version.

createdAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
createdBy
string

Versioned prompt content.

PromptDefinition

Versioned prompt content.

content
string* required

Prompt template content.

variables
array<PromptVariable>

Variables used by the prompt.

PromptVariable
name
string

Stable object name.

description
string

Display description.

id
string
latestVersion
int32

Latest version number.

Example:

1
name
string

Stable object name.

notes
string

Notes for this version.

sharingScope
"sharing_scope_unspecified" | "private" | "workspace"
title
string

Display title.

updatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
version
int32

Example:

1
versionCreatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s

PATCH /v2/prompts/{prompt_id}/versions/{version}

UpdatePromptVersionMetadata

UpdatePromptVersionMetadata

Parameters

prompt_id
stringpath* required
version
int32path* required

Request Example

{}

Request Body

aliases
AliasList

Presence wrapper for a set of alias labels on update RPCs. As a message field it carries presence, so callers can distinguish "leave aliases unchanged" (field omitted) from "clear all aliases" (field set, empty values).

AliasList

Presence wrapper for a set of alias labels on update RPCs. As a message field it carries presence, so callers can distinguish "leave aliases unchanged" (field omitted) from "clear all aliases" (field set, empty values).

values
array<string>
notes
string | null

Notes for this version.

Responses

Success

aliases
array<string>

Aliases pointing to this version.

createdAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
createdBy
string

Versioned prompt content.

PromptDefinition

Versioned prompt content.

content
string* required

Prompt template content.

variables
array<PromptVariable>

Variables used by the prompt.

PromptVariable
name
string

Stable object name.

description
string

Display description.

id
string
latestVersion
int32

Latest version number.

Example:

1
name
string

Stable object name.

notes
string

Notes for this version.

sharingScope
"sharing_scope_unspecified" | "private" | "workspace"
title
string

Display title.

updatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s
version
int32

Example:

1
versionCreatedAt
date-time

RFC 3339 timestamp.

Examples:

1s
1.000340012s