Skip to content

Does this SDK support proxy settings similar to OpenAI's SDK? #114

@SchneeHertz

Description

@SchneeHertz

I'm using OpenRouter on a corporate network and need to access it through a proxy. Does the OpenRouter SDK support proxy settings?
Does it support the same settings as the OpenAI SDK, or is there another way? I couldn't find any relevant information in the documentation

import OpenAI from 'openai';
import * as undici from 'undici';

const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
const client = new OpenAI({
  fetchOptions: {
    dispatcher: proxyAgent,
  },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions