Docs Guides
Guide

Python OpenAI Official SDK (AutoGPT, LangChain, etc.)

import openai # Set API base URL and key openai.api_base = "https://api.digislash.com/v1" openai.api_key = "sk-xxxxxxxxx"

Option 1: Configure OpenAI directly

import openai # Set API base URL and key openai.api_base = "https://api.digislash.com/v1" openai.api_key = "sk-xxxxxxxxx"
json

Option 2: Environment variables

If Option 1 does not work, try this.

Set these environment variables:

OPENAI_API_BASE=https://api.digislash.com/v1 OPENAI_API_KEY=sk-xxxxx
json
Note: If changes do not take effect, restart the system.

Option 3: OpenAI client

from openai import OpenAI # Initialize client client = OpenAI( base_url="https://api.digislash.com/v1", api_key='YOUR_API_KEY', timeout=120 ) # Create chat completion response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Who won the world series in 2020?"}, {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."}, {"role": "user", "content": "Where was it played?"} ] ) print(response) # responses format response = client.responses.create( model="gpt-5", input="Write a one-sentence bedtime story about a unicorn." ) print(response.output_text)
json