Skip to content

Add proxy support #263

Closed
Closed
@ovchinnikovndre1

Description

@ovchinnikovndre1

Hi. How do I add proxy support? I tried it like this :
$proxies = [
'http' => 'http://login:pass@ip:port',
];

    $client = new Client([
        RequestOptions::PROXY => $proxies,
        RequestOptions::VERIFY => false,
        RequestOptions::TIMEOUT => 30,
    ]);

    $this->client = OpenAI::factory()
                          ->withApiKey(config('openai.api_key'))
                          ->withHttpClient($client)
                          ->make();

But I still get 500 error /var/www/vendor/openai-php/client/src/Resources/Chat.php ", line: 32

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