Drop-in OpenAI-shaped client for Cursor models — LangChain and LangGraph compatible.
Library author
Cursor's model API doesn't match the OpenAI SDK shape, making it hard to use Cursor models in existing OpenAI-compatible tooling and LangChain/LangGraph pipelines.
I published cursor-openai, an npm package that provides a drop-in OpenAI-shaped client for Cursor models. Pass a Cursor API key and model id, then call chat.completions.create or use LangChain/LangGraph bindings. Runs in-process via @cursor/sdk with no Express gateway required.
TypeScript library wrapping @cursor/sdk. Exposes createCursorClient() with OpenAI-compatible chat.completions API including streaming and usage tracking. CursorChatModel class for LangChain/LangGraph integration with bindTools support. Model resolution handles Cursor catalog aliases. MIT licensed, published on npm.