Why Use AI Coding Tools with Corti?
Faster Integration
Generate working code examples from natural language descriptions of your use case
API Discovery
Quickly understand endpoint patterns, request/response structures, and authentication flows
Error Handling
Generate robust error handling and retry logic based on Corti’s error codes
Code Generation
Create SDK wrappers, test suites, and integration examples tailored to your stack
Corti API Documentation for LLMs
Corti provides machine-readable documentation specifically formatted for LLMs and AI coding tools:llms.txt
Concise API reference optimized for LLM context windows. Perfect for quick lookups and code generation.
llms-full.txt
Comprehensive documentation including guides, examples, and detailed specifications. Use when you need full context.
Getting Started
1
Configure Your AI Tool
Most AI coding assistants can be configured to use external documentation sources. Here are common approaches:
Cursor / Cline
Cursor / Cline
Cursor can access web URLs directly. Reference the llms.txt files in your prompts:
GitHub Copilot
GitHub Copilot
Copilot works best when you provide context in comments. Reference the documentation:
Claude Code / Other LLMs
Claude Code / Other LLMs
Include the documentation URL in your system prompt or initial message:
2
Start with Authentication
Ask your AI assistant to generate authentication code based on Corti’s OAuth 2.0 client credentials flow. Here’s a prompt you can use:
3
Create an Interaction
Once authentication is working, generate code to create an interaction:
The response will include an
interactionId (UUID) and a websocketUrl that you’ll need for streaming endpoints.4
Connect to WebSocket Endpoints
For real-time features, generate WebSocket client code:
5
Add Error Handling
Generate robust error handling based on Corti’s error codes:
Reference the complete error code list in your prompt to ensure all error scenarios are covered.
6
Refine and Test
Use AI assistants to:
- Add error handling based on Corti error codes
- Generate unit tests for your integration
- Create mock responses for development
- Document your code with examples
Best Practices
Effective Prompting
1
Be Specific
Include details about:
- Your programming language and framework
- Specific endpoints you want to use
- Expected behavior and error handling
- Authentication requirements
2
Reference Documentation
Always mention the llms.txt or llms-full.txt URLs in your prompts to ensure the AI uses current, accurate API information.
3
Iterate Incrementally
Start with simple examples, then ask the AI to extend them. For example:
- “Create a function to authenticate”
- “Now add a function to create an interaction”
- “Add error handling and retry logic”
4
Validate Generated Code
Always review and test AI-generated code. Check that it:
- Uses correct endpoint URLs and parameters
- Handles authentication properly
- Follows Corti API patterns
- Includes appropriate error handling
Common Use Cases
SDK Wrappers
Generate language-specific SDK wrappers around Corti REST APIs. Ask your AI assistant to create classes and methods that match your preferred patterns.
WebSocket Clients
Create WebSocket clients for
/transcribe and /stream endpoints with proper connection management, reconnection logic, and message handling.Integration Examples
Generate complete integration examples for common workflows like ambient documentation, dictation, or agentic automation.
Test Suites
Create comprehensive test suites with mocked API responses, error scenarios, and integration tests.
Step-by-Step Examples
Example 1: Generate Document from Transcript
Example 2: Upload Recording and Create Transcript
Example 3: Extract Facts from Text
Example 4: Create Agent with Custom Expert
Resources
API Reference
Browse the complete API reference with interactive examples
JavaScript SDK
Reference implementation showing best practices
Quickstart Guides
Step-by-step guides for common workflows
Error Codes
Complete list of error codes and solutions
Next Steps
- Explore the Agentic Framework for building AI agents
- Check out SDK examples for real-world patterns
- Review authentication best practices
- Join the Corti community for support
AI-generated code should always be reviewed and tested before use in production. While AI tools can accelerate development, human oversight ensures correctness, security, and compliance with healthcare regulations.