Martian Model Router
  • Getting Started
    • Introduction
    • Hello World
    • Integrating Router
      • OpenAI Python
      • OpenAI Node
      • OpenAI cURL
      • LangChain Python
      • LangChain JS
    • Benchmarking Router
    • Router Parameters
    • Supported Models
Powered by GitBook
On this page
  1. Getting Started
  2. Integrating Router

OpenAI cURL

Usage

The following request

curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
  "model": "gpt-3.5-turbo",
  "messages": [
    {
      "role": "user",
      "content": "Hello world!"
    },
    {
      "role": "assistant",
      "content": "Hello! How can I assist you today?"
    }
  ],
}'

becomes

curl https://withmartian.com/api/openai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MARTIAN_API_KEY" \
  -d '{
  "model": "router",
  "messages": [
    {
      "role": "user",
      "content": "Hello world!"
    },
    {
      "role": "assistant",
      "content": "Hello! How can I assist you today?"
    }
  ],
}'
PreviousOpenAI NodeNextLangChain Python

Last updated 11 months ago