POST/v2/projects/{projectId}/prompts/run

Run a project prompt

Runs a prompt for a project using a specified provider, key, and target language. Supply keyId, provider, and targetLanguageId; optionally set a template or choose basicPromptOptions to customize the prompt context. The response includes the generated prompt and result.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 5 body fields
projectIdintegerrequired
The integer identifier of the project in which to run the prompt.

Prompt run configuration. keyId, provider, and targetLanguageId are required.

basicPromptOptionsarray<string>optional
Prompt context options to include: KEY_NAME, KEY_DESCRIPTION, KEY_CONTEXT, PROJECT_DESCRIPTION, LANGUAGE_NOTES, TM_SUGGESTIONS, SCREENSHOT, or GLOSSARY.
keyIdintegerrequired
The integer identifier of the key to use as prompt context.
providerstringrequired
The provider to use to run the prompt.
targetLanguageIdintegerrequired
The integer identifier of the target language.
templatestringoptional
A prompt template to use for this run.

5 status codes
200Returns the generated `prompt` and `result`. The response may also include parsed JSON, price, and usage information.
parsedJsonobjectoptional
priceintegeroptional
promptstringrequired
resultstringrequired
usageobjectoptional
400Returned when a required field is missing or a request value is invalid.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is not authenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when the authenticated user does not have permission to run prompts for the project.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the project or a requested resource cannot be found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when required fields are missing or a value is invalid; keyId, provider, and targetLanguageId are required, and each basicPromptOptions value must be one of the supported options. A 401 is returned when the request is unauthenticated, and a 403 is returned when the authenticated user cannot run prompts for the project. A 404 is returned when the project or a requested resource cannot be found; the projectId path parameter must identify the project.