Python
import openai
openai.api_base = "https://tokoyo.cheatgpt.top/v1"
Golang
package main
import (
openai "github.com/sashabaranov/go-openai"
)
func main() {
config := openai.DefaultConfig("your key")
config.BaseURL = "https://tokoyo.cheatgpt.top/v1"
client := openai.NewClientWithConfig(config)
print(client)
}
Nodejs
import { Configuration } from "openai";
const configuration = new Configuration({
apiKey: OPENAI_API_KEY,
basePath: "https://tokoyo.cheatgpt.top/v1",
});
PHP
$yourApiKey = getenv('YOUR_API_KEY');
$client = OpenAI::factory()
->withApiKey($yourApiKey)
->withOrganization('your-organization')
->withBaseUri('tokoyo.cheatgpt.top/v1')
->withHttpClient($client = new \GuzzleHttp\Client([]))
->withHttpHeader('X-My-Header', 'foo')
->withQueryParam('my-param', 'bar')
->withStreamHandler(fn (RequestInterface $request): ResponseInterface => $client->send($request, [
'stream' => true // Allows to provide a custom stream handler for the http client.
]))
->make();