Switch language

OpenAI Agents SDK

Run OpenAI Agents against Bitdeer AI's inference endpoints.

The OpenAI Agents SDK can target Bitdeer by setting the inference base URL and your Bitdeer API key.

Installation

pip install openai-agents

Configuration

Set the environment variables to point at Bitdeer AI:

export OPENAI_API_KEY="YOUR_BITDEER_API_KEY"
export OPENAI_BASE_URL="https://api-inference.bitdeer.ai/v1"

Basic agent

from agents import Agent, Runner

agent = Agent(
    name="assistant",
    instructions="You are a helpful assistant that answers questions concisely.",
    model="deepseek-ai/DeepSeek-V4-Pro",
)

result = Runner.run_sync(agent, "What is serverless inference?")
print(result.final_output)

Agent with tools

from agents import Agent, Runner, function_tool

@function_tool
def get_weather(city: str) -> str:
    """Get the weather for a city."""
    return f"The weather in {city} is 22°C and sunny."

agent = Agent(
    name="weather-bot",
    instructions="Help users check the weather.",
    model="deepseek-ai/DeepSeek-V4-Pro",
    tools=[get_weather],
)

result = Runner.run_sync(agent, "What's the weather in Tokyo?")
print(result.final_output)

Tool calling is model-specific. Confirm that your model exposes tools / function calling in the Model Catalog and the Bitdeer console before shipping agents that depend on it.

Last updated on

On this page

OpenAI Agents SDK · Bitdeer AI