Skip to main content
Cursor is an AI-first code editor. This page shows you how to configure it for productive work against the Pictory API: project-level rules that teach Cursor the API conventions, MCP integration for direct API calls, and example prompts.

Prerequisites

Setup

1

Open your project in Cursor

Open the project where you want to integrate the Pictory API.
2

Store your Pictory API key

Add the key to your shell profile (do not commit it):
Cursor inherits environment variables from the shell you launched it from. On Windows, use a .env file at the project root and add .env to .gitignore.
3

Create project rules

Cursor reads .cursor/rules/*.mdc files automatically. Create the directory and rules file below.
4

Add the Pictory rules file

Use the template in the next section to populate .cursor/rules/pictory-api.mdc.
Create .cursor/rules/pictory-api.mdc:

OpenAPI as a Tool Schema

Cursor’s Agent mode can ingest an OpenAPI spec as a structured tool. Add this to your rules:

Connecting via MCP

To let Cursor’s Agent mode call the Pictory API as a tool (instead of generating code), connect the Pictory MCP server. Setup at Pictory MCP Server.

Example Prompts

  • “Generate a TypeScript client for the Pictory storyboard render endpoint, using the OpenAPI spec at https://docs.pictory.ai/openapi.json.”
  • “Build a React component that lets a user paste a script, choose a language and voice, and submit it to the Pictory render API.”
  • “Add error handling for 400 responses to this Pictory integration; surface the validation message to the user.”
  • “Refactor my polling loop to use 15-second intervals and exponential backoff capped at 60 seconds.”

Troubleshooting

Cause: Default LLM bias toward Bearer flows.Resolution: Reinforce the rule in .cursor/rules/pictory-api.mdc. If Cursor still suggests Bearer in a session, correct it once and the agent will adapt.
Cause: Common causes: missing videoName, both brandId and brandName included, or invalid language code.Resolution: Paste the API error response back into Cursor; it will adjust. Also confirm your rules file lists the field constraints.
Cause: Cursor was launched before the env var was exported in your shell.Resolution: Restart Cursor after sourcing your .zshrc / .bashrc. On Windows, restart Cursor after setting the env var via System Properties.

Next Steps

Use Pictory with an LLM

System prompts, MCP, and example flows

End-to-End Recipes

Ready-to-run JSON payloads

Claude Code Setup

Same setup, for Claude Code users

Windsurf Setup

Same setup, for Windsurf users