Prompts
List Prompts
Returns a list of your prompts. The prompts are returned sorted by creation date, with the most recent prompts appearing firstfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.list(limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Create a Prompt
Create a promptfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.create(request={
"display_name": "Raymundo83",
"prompt": {
"messages": [
{
"role": "system",
"content": "You are a helpful assistant",
},
{
"role": "user",
"content": "What is the weather today?",
},
],
"model": "openai/gpt-4o",
"max_tokens": 1000,
"temperature": 0.7,
},
"path": "Default",
})
# Handle response
print(res)
Show Parameters
Show Parameters
Show Properties of metadata
Show Properties of metadata
Show Properties of prompt
Show Properties of prompt
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}. The full list of models can be found at https://docs.orq.ai/docs/ai-gateway-supported-models. Only chat models are supported.Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
Show Response
Show Response
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Retrieve a Prompt
Retrieves a prompt objectfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.retrieve(id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Update a Prompt
Update a promptfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.update(id="<id>", prompt={
"messages": [
{
"role": "system",
"content": "You are a helpful assistant",
},
{
"role": "user",
"content": "Hello!",
},
],
"model": "anthropic/claude-3-5-sonnet-20241022",
"temperature": 0.5,
}, path="Default")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Delete a Prompt
Delete a promptfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.prompts.delete(id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
List Versions
Returns a list of your prompt versions. The prompt versions are returned sorted by creation date, with the most recent prompt versions appearing firstfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.list_versions(prompt_id="<id>", limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Show Properties of data
Show Properties of data
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.Get Version
Retrieves a specific version of a prompt by its ID and version ID.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.prompts.get_version(prompt_id="<id>", version_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
Show Response
Show Response
prompt property instead. A list of messages compatible with the openAI schema.Show Properties of ~~`promptConfig`~~
Show Properties of ~~`promptConfig`~~
Show Properties of modelParameters
Show Properties of modelParameters
chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.chat and completion models.image models.image models.image models.image models.image models.\{ "type": "json_schema", "json_schema": \{...\} \} enables Structured Outputs which ensures the model will match your supplied JSON schema Setting to \{ "type": "json_object" \} enables JSON mode, which ensures the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason=“length”, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.leonardoai providerAnthropicShow Properties of prompt
Show Properties of prompt
Show Properties of audio
Show Properties of audio
[Deprecated]. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - All models before gpt-5.1 default to medium reasoning effort, and do not support none. - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - xhigh is currently only supported for gpt-5.1-codex-max. Any of “none”, “minimal”, “low”, “medium”, “high”, “xhigh”.Show Properties of guardrails
Show Properties of guardrails
Show Properties of retry
Show Properties of retry
Show Properties of cache
Show Properties of cache
openai/gpt-4o or anthropic/claude-3-5-sonnet-20241022. For private models, use format: \{workspaceKey\}@\{provider\}/\{model\}.