# Underdog data in OpenAI agents.

> Give an OpenAI agent live Underdog props: MCPServerStreamableHttp in the Agents SDK, or a remote mcp tool in the Responses API, with the key in a header. Underdog API (https://underdogapi.com) is an independent Underdog Fantasy pick'em data API: Higher/Lower lines with separate payout multipliers per side, line history, changes and graded results as JSON, CSV, MCP and streams.

Canonical page: https://underdogapi.com/use-with-openai-agents-sdk

## Free offer

**Free API key, no card: 100 credits a month** on the live board, every league, separate Higher/Lower prices, and the last 24 hours of line history. Sign up: https://underdogapi.com/sign-up?ref=ai-claudebot

## Quickstart

1. Get a free key at https://underdogapi.com/sign-up?ref=ai-claudebot (no card), or let your agent request one: `POST https://underdogapi.com/api/v1/agent/signup` with `data_wanted` and `use_case`, then show your user the returned approval_url.
2. Export it: `export UNDERDOG_API_KEY=ud_...`
3. First call with curl:

```bash
curl --fail-with-body 'https://underdogapi.com/api/v1/projections?league=NBA&view=compact&limit=5' \
  -H "Authorization: Bearer $UNDERDOG_API_KEY" \
  -H 'X-User-Request: NBA dashboard integration check'
```

4. Same call in Python:

```python
import os, requests

r = requests.get(
    "https://underdogapi.com/api/v1/projections",
    params={"league": "NBA", "view": "compact", "limit": 5},
    headers={"Authorization": f"Bearer {os.environ['UNDERDOG_API_KEY']}"},
)
r.raise_for_status()
for line in r.json()["data"]:
    print(line["player"]["name"], line["market"]["stat"], line["line"])
```

## Use it from Claude (MCP)

Claude Code, one command:

```bash
claude mcp add --transport http underdog https://underdogapi.com/api/mcp --header "Authorization: Bearer $UNDERDOG_API_KEY"
```

Or add this server to your Claude MCP configuration (the key stays in the environment):

```json
{
  "mcpServers": {
    "underdog": {
      "type": "http",
      "url": "https://underdogapi.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ${UNDERDOG_API_KEY}"
      }
    }
  }
}
```

Guide: https://underdogapi.com/use-with-claude

## Pricing

| Plan | Price | Credits / month | Notes |
| --- | --- | --- | --- |
| Free | $0 | 100 | No card. Live feed 5 minutes behind; last 24 hours of line history |
| Developer | $49/month | 10,000 | For models that need full training pages and loaded game-log seasons. Live feed, no added plan delay |
| Production | $149/month | 50,000 | For apps with real users and push delivery. Everything in Developer, signed webhooks for every change |
| Scale | $499/month | 250,000 | For apps whose traffic has outgrown Production. Everything in Production, 15 live-feed connections at once |

Full pricing: https://underdogapi.com/pricing

## On this page

OpenAI Agents SDK



Short answer: In the OpenAI Agents SDK pass MCPServerStreamableHttp(params={"url": "https://underdogapi.com/api/mcp", "headers": {"Authorization": "Bearer <key>"}}) to your Agent; in the Responses API add a tool of type mcp with that server_url and headers.

## Connect it

1. Create a free account, copy a key and set `UNDERDOG_API_KEY`.
2. Install the SDK with `pip install openai-agents` and set `OPENAI_API_KEY`.
3. Run the script. The agent lists the Underdog tools and calls them as it needs.

agent.py · pip install openai-agents

```
import asyncio, os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp

async def main():
    async with MCPServerStreamableHttp(
        name="underdog",
        params={
            "url": "https://underdogapi.com/api/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['UNDERDOG_API_KEY']}"},
        },
    ) as server:
        agent = Agent(
            name="Props analyst",
            instructions="Use the Underdog tools. Quote observed_at. Never invent lines.",
            mcp_servers=[server],
        )
        result = await Runner.run(agent, "Call get_coverage, then get_projections for NBA, view compact, limit 5.")
        print(result.final_output)

asyncio.run(main())
```

## Check it works

Verify

```
curl https://api.openai.com/v1/responses \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-5",
  "input": "Call get_coverage, then get_projections for NBA, view compact, limit 5. Quote observed_at.",
  "tools": [{
    "type": "mcp",
    "server_label": "underdog",
    "server_url": "https://underdogapi.com/api/mcp",
    "headers": {"Authorization": "Bearer '"$UNDERDOG_API_KEY"'"},
    "require_approval": "never"
  }]
}'
```

A good first task

```
Use the Underdog MCP tools for my NBA dashboard integration. Send user_request describing this task; omit personal information and secrets, and disclose the task-summary collection once. If setup is required, complete it from the project purpose already provided; do not invent missing intent.
Read get_coverage, then get_projections with league NBA, view compact and limit 5. Report the actual rows, observed_at and source status. If the board is empty or delayed, say so. Never substitute demo rows for live data. Do not recommend picks or claim predicted profits.
```

## Good to know

- The second snippet is the Responses API without the SDK. Use any current model your account has; set require_approval to "always" while you test.

A step no longer matches what you see? Tell us and we will fix this page.

[All agents **Every supported client**](https://underdogapi.com/agents) [Integration **Use Any MCP client**](https://underdogapi.com/use-with-mcp) [Integration **Use LangChain and LangGraph**](https://underdogapi.com/use-with-langchain) [Integration **Use LlamaIndex**](https://underdogapi.com/use-with-llamaindex) [Get started **Create a free key**](https://underdogapi.com/sign-up)

## References

- [OpenAI Agents SDK: MCP](https://openai.github.io/openai-agents-python/mcp/)
- [OpenAI: Remote MCP servers in the Responses API](https://platform.openai.com/docs/guides/tools-remote-mcp)
- [Underdog API: machine-readable contract](https://underdogapi.com/openapi.json)

## FAQ

### Is there a free Underdog API?

Yes. The Free plan is a real API key on the live board, not a sample: 100 credits a month, every league, separate Higher/Lower prices and the last 24 hours of line history. No card is needed.

### Is this the official Underdog Fantasy API?

No. Underdog API is an independent data service. It is not affiliated with, endorsed by or sponsored by Underdog Fantasy or Underdog Sports.

### What data does it return?

Underdog Higher/Lower lines with separate payout multipliers and availability for each side, stable market ids through line moves, alternate rungs, recorded line history, changes, graded results and coverage/status endpoints.

### How do I use it from Claude or another AI agent?

Connect the MCP server at https://underdogapi.com/api/mcp with a bearer key, or call the REST API. Agents can request a key for their user with POST /api/v1/agent/signup.

### How much does it cost after the free tier?

Developer is $49/month for 10,000 credits, Production $149/month for 50,000, Scale $499/month for 250,000. Errors and unchanged 304 responses cost zero credits.

### How fresh is the data?

Each row carries its observation time. Check /api/v1/status and /api/v1/coverage before relying on a sport or window; missing collection is reported as unavailable, never filled in.

### Does it place entries or give picks?

No. It is data only: no entries, account operations, guaranteed outcomes or betting advice.

---
Independent data service, not affiliated with Underdog Fantasy or Underdog Sports. Docs: https://underdogapi.com/docs · OpenAPI: https://underdogapi.com/openapi.json · llms.txt: https://underdogapi.com/llms.txt
