Skip to main content
This page provides code examples for common v1 API use cases.

Quick Examples

Session secrets allow you to provide temporary credentials or API keys that are only available for a single session and are not stored in your organization’s secrets.
Notes:
  • Secret keys must follow environment variable naming conventions (start with a letter or underscore, followed by letters, numbers, or underscores)
  • The sensitive field defaults to true if not specified
  • Session secrets are only available in the session they are created with and are not stored in organization secrets
Here’s a complete example that demonstrates how to use the Devin API to analyze GitHub repositories. This example shows:
  • Authentication and error handling
  • Creating and monitoring sessions
  • Processing structured output
  • Proper resource management with async/await

Advanced Examples

Automated QA Testing

See how we use Devin to QA test Devin itself. Automate end-to-end testing using Devin’s browser capabilities.

Automated PR Reviews

Learn how to integrate Devin with GitHub Actions for automated PR reviews.

Support

Need Help?

For questions about the API or to report issues, email support@cognition.ai