> ## Documentation Index
> Fetch the complete documentation index at: https://docs.danubeai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI Agents SDK

> Give an OpenAI Agents SDK agent every Danube tool through three function tools

## Install

```bash theme={null}
pip install "danube[openai-agents]"
export DANUBE_API_KEY=...   # from the dashboard, or POST /v1/agents for a self-registered agent
```

## Use

```python theme={null}
from agents import Agent, Runner
from danube import DanubeClient
from danube.integrations.openai_agents import danube_tools

client = DanubeClient()  # reads DANUBE_API_KEY

agent = Agent(
    name="assistant",
    instructions="Use Danube to find and call tools. Search before assuming a capability exists.",
    tools=danube_tools(client),
)

result = Runner.run_sync(agent, "What are the top three Hacker News stories right now?")
print(result.final_output)
```

`danube_tools(client)` returns three `FunctionTool`s:

| tool                                       | what the agent gets                                                                                                                  |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `danube_search_tools(query, limit)`        | tool ids, descriptions and parameter schemas from the whole catalog, with `readiness` and `reliability` when the backend stamps them |
| `danube_describe_tool(tool_id)`            | the full schema, tips from earlier callers, readiness for this account                                                               |
| `danube_execute_tool(tool_id, parameters)` | the tool's result, or an error that says what to do (connect a service, fix an argument)                                             |

Options: `service_id` to limit search to one service, `ready_only=True` to hide tools this account has not connected, `max_results` for the search page size.

The Danube client is synchronous; the adapter runs it in a worker thread so the agent loop stays responsive.

## Why three tools rather than one per catalog entry

The catalog has thousands of tools; putting them all in the model's context is slow and expensive, and the set changes daily. Search first keeps the prompt small and always current, and `describe` gives the model the schema only for the tool it is about to call.
