Skip to main content

Overview

Cursor is an AI-powered IDE that makes it easy to write code while integrating with Yield.xyz APIs. Here’s how to set up Cursor to build with our documentation. This will let you interact with our docs directly and get the most accurate answers to your questions.

Quick Setup

1

Open Cursor Settings

Go to Cursor SettingsFeaturesDocs and click ”+ Add new doc”
2

Add Yield.xyz Docs

Paste this URL:
3

Configure the Doc

  • Change the name to Yield.xyz
  • Leave everything else the same
4

Wait for Indexing

Wait until the docs have been fully indexed. You can check the progress in Cursor Settings.
5

Reference in Prompts

Now you can reference the Yield.xyz docs in your prompt using @Yield.xyz

Adding the OpenAPI Spec

For even better API understanding, add the OpenAPI spec:
1

Add OpenAPI Spec

In Cursor Settings → Docs, add another doc with URL:
2

Name it

Name it Yield.xyz API to distinguish from the main docs

Example Usage

Once set up, you can reference Yield.xyz docs in your prompts:

Generate API Calls

Understand Responses

Fix Errors

Build Complete Flows


Discovery

Enter Flow

Balance Tracking

Manage Actions


Best Practices

Be Specific

Reference specific endpoints or concepts from the docs

Share Context

Include error messages and your current code

Reference Docs

Always use @Yield.xyz to ground the AI in accurate information

Verify Code

Always test generated code against the actual API

Troubleshooting

Check that the URL is correct and accessible. Try refreshing Cursor settings.
Make sure to reference @Yield.xyz in your prompt to use the indexed docs rather than training data.
Verify your API key is correct and you’re using the right endpoint format. Check our API Reference.

Next Steps

Prompting Patterns

Effective prompts for Yield.xyz

Guardrails

AI safety best practices