OpenAI SDK
title: OpenAI SDK subtitle: Using OpenRouter with OpenAI SDK headline: ‘OpenAI SDK Integration | OpenRouter SDK Support’ canonical-url: https://openrouter.ai/docs/guides/community/openai-sdk og:site_name: OpenRouter Documentation og:title: ‘OpenAI SDK Integration - OpenRouter SDK Support’ og:description: ‘Integrate OpenRouter using the official OpenAI SDK. Complete guide for OpenAI SDK integration with OpenRouter for Python and TypeScript.’ og:image: https://openrouter.ai/dynamic-og?title=OpenAI%20SDK&description=OpenAI%20SDK%20Integration og:image:width: 1200 og:image:height: 630 twitter:card: summary_large_image twitter:site: ‘@OpenRouterAI’ noindex: false nofollow: false
Using the OpenAI SDK
- Using
pip install openai: github. - Using
npm i openai: github.You can also use Grit to automatically migrate your code. Simply run
npx @getgrit/launcher openrouter.