Quickstart - Integrating Martian Into Your Codebase

Integrate Martian Into Your Codebase In Just A Few Lines of Code

Integrating Martian's Model Router is incredibly easy. We let you use our router via a drop-in replacement for OpenAI:

  • Update your BASE_URL to https://route.withmartian.com/api/openai/v1

  • Update your OPENAI_API_KEY to your Martian API Key

    • If you haven't created a Martian API Key yet, you can do so here

To make the process even easier, we also provide custom Python and NodeJS SDKs.

Below, you'll find instructions for a drop-in replacement for a number of different languages and libraries.

When you first integrate, you can keep using your existing model and benchmark its performance against the router. Once you're confident in its performance, you can switch to the router.

If you are not currently using one of the below methods, but want to switch to the router, you can use the API reference, or contact us via contact@withmartian.com.

Last updated