openai-agents-gemini

Configures OpenAI Agents SDK agents to run on Google Gemini models via the OpenAI-compatible API.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/ramshan00/hackaton --skill openai-agents-gemini-ramshan00
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openai-agents-gemini
Source: https://github.com/ramshan00/hackaton/tree/main/Hackathon2-phase3/.claude/skills/openai-agents-gemini
Command: npx skills add https://github.com/ramshan00/hackaton --skill openai-agents-gemini-ramshan00

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai-agents, python-dotenv, and includes references (resource) and assets (resource) components.

What problem does it solve? Setting up the OpenAI Agents SDK to work with Google's Gemini models requires non-obvious configuration of a custom AsyncOpenAI client, base URL, and model wrapper, which this Skill scaffolds for you. ## Core Features & Use Cases - Gemini Backend Configuration: Creates an AsyncOpenAI client pointed at the generativelanguage.googleapis.com endpoint and wraps it in OpenAIChatCompletionsModel. - Runnable Agent Script: Generates agent_gemini.py with function tools, agent definitions, and synchronous Runner execution. - Environment Setup: Provides a .env template for GEMINI_API_KEY and a dummy OPENAI_API_KEY for SDK tracing. - Use Case: You want to build a travel assistant agent with tool calling but only have a Google AI Studio API key; this Skill produces a working agent_gemini.py you can run immediately. ## Quick Start Ask the agent to set up an OpenAI Agents SDK project using Gemini as the backend model with a runnable Python script and .env template.

Frequently Asked Questions about openai-agents-gemini

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use OpenAI Agents SDK with Gemini models?

Create an AsyncOpenAI client with base_url set to https://generativelanguage.googleapis.com/v1beta/openai/ and your GEMINI_API_KEY, then wrap it in OpenAIChatCompletionsModel and pass it to the Agent's model parameter.

How to define tools for a Gemini-backed agent in Python?

Use the @function_tool decorator on synchronous Python functions with type hints and docstrings. Attach them to the Agent via the tools list, and Gemini will use the docstrings to understand when to call each tool.

Do I need an OpenAI API key when using Gemini with the Agents SDK?

The SDK may require OPENAI_API_KEY for internal tracing even when Gemini handles inference. You can set it to a dummy value in your .env file if strict tracing is not needed.

Can I run the agent synchronously in a script?

Yes, use Runner.run_sync(agent, input) for synchronous execution, which is simplest for CLI scripts. Use Runner.run(agent, input) inside async contexts instead.

What are the limitations of using Gemini through the OpenAI-compatible API?

Tool choice control may behave differently than with GPT-4, and the setup uses API key auth rather than Google Cloud OAuth. The agent runs locally and is not deployed to a server by this configuration.