# Connect ChatGPT to SAM.gov data

To use SAM.gov data in ChatGPT, add samgovapi.io as a custom MCP server with no authentication, which gives the keyless search and fetch tools over the public lookup pages, or build a GPT whose Actions import https://samgovapi.io/openapi-chatgpt.json with API key, Bearer authentication for the full metered API.

ChatGPT's custom MCP servers authenticate with OAuth or not at all; there is no field for an API key header. This server's search and fetch tools were built for exactly that case: they need no key and answer from the public lookup pages. Full data access with your key goes through GPT Actions and a trimmed OpenAPI document made for them.

- Connects with: MCP or REST
- MCP server: https://samgovapi.io/api/mcp
- REST base: https://samgovapi.io/api/v1
- Auth: Authorization: Bearer <key>, kept in SAMGOVAPI_API_KEY

## Get a key

Free key at https://samgovapi.io/sign-up, or have the agent call start_signup and approve the link it shows you. With Actions, ChatGPT stores the key in the GPT's action settings. With the keyless MCP server there is no key at all.

## Set up ChatGPT

1. Option A: custom MCP server (keyless): On plans that offer custom MCP servers, add one with the URL below and No authentication. ChatGPT can then search companies, NAICS codes and open notices and fetch any result as text.

2. Option B: a GPT with Actions (full API): In the GPT editor, create an action, import the schema from the URL below, and set Authentication to API key, Bearer, with your key. The schema lists the GET endpoints that need no Pro or Scale plan.

Schema URL:

```
https://samgovapi.io/openapi-chatgpt.json
```

3. Ask a question: In either setup, ask for a company's registration status by UEI and check the answer quotes a data date.

## Finish account setup once

Data tools unlock after the account answers its onboarding questions: ask the agent to set up your samgovapi account (get_onboarding_questions, then answer_onboarding). Free.

## Check that it works

Ask: "Is UEI ZXBCU6K5KL99 registered in SAM.gov, and when does its registration expire?"

Expected tool call:

```json
{"name":"registration_status","arguments":{"id":"ZXBCU6K5KL99","user_request":"check a registration and its expiry"}}
```

## Things to know

- OpenAI has announced that custom GPTs retire on 11 December 2026 in favour of apps and plugins; Option B works until then, Option A is the lasting route.
- Custom MCP servers are limited to certain ChatGPT plans and, in workspaces, to admins.

## Troubleshooting

- Data tools are missing in the MCP connection: Expected: without OAuth there is no key, so only keyless tools run. Use Option B or another client for metered tools.
- Actions return 401: Check Authentication is API key with Bearer selected, and the key starts with sg_.
- Answers lack dates: Ask ChatGPT to quote meta.as_of or the data-as-of line in each answer.

## Questions

### Why a separate OpenAPI file for ChatGPT?

GPT Actions cap the number of operations and description length. /openapi-chatgpt.json keeps the most useful GET endpoints within those limits.

## Official documentation

- OpenAI: build a custom MCP server for ChatGPT: https://developers.openai.com/api/docs/guides/custom-mcp-server
- OpenAI Help: configuring actions in GPTs: https://help.openai.com/en/articles/9442513-configuring-actions-in-gpts

Checked 2026-11-13. All guides: https://samgovapi.io/agents.md

Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.
