Code and agent SDKs
Everything you need to call Isopleth from your own code or agent. Set two environment variables, pick your stack and
paste. Every snippet reads the key from ISOPLETH_KEY; keep it on the server.
export ISOPLETH_KEY=paste_your_key_here export ISOPLETH_BASE_URL=https://api.isopleth.dev
No key yet? Get a free API key (1,000 free lookups every month · no card).
Create or copy a key on your dashboard. Keys are shown once when you create them.
Drop-in snippets
REST, no SDK needed.
curl https://api.isopleth.dev/v1/fetch \
-H "Authorization: Bearer $ISOPLETH_KEY" \
-H "Content-Type: application/json" \
-d '{"lat": 30.2672, "lng": -97.7431,
"fields": ["nfhl_flood_zone", "elevation", "nearest_substation_distance_m"]}'pip install requests
import os, requests
r = requests.post(
"https://api.isopleth.dev/v1/fetch",
headers={"Authorization": f"Bearer {os.environ['ISOPLETH_KEY']}"},
json={"lat": 30.2672, "lng": -97.7431,
"fields": ["nfhl_flood_zone", "elevation", "nearest_substation_distance_m"]},
timeout=60,
)
r.raise_for_status()
for name, f in r.json()["fields"].items():
print(name, f["value"], f.get("unit"), f["source"])Node 18+, Deno, Bun or a server route. Keep the key server side.
const r = await fetch("https://api.isopleth.dev/v1/fetch", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ISOPLETH_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
lat: 30.2672, lng: -97.7431,
fields: ["nfhl_flood_zone", "elevation", "nearest_substation_distance_m"],
}),
});
const { fields } = await r.json();
for (const [name, f] of Object.entries(fields)) console.log(name, f.value, f.unit, f.source);pip install openai. OpenAI calls the Isopleth MCP server for you.
import os
from openai import OpenAI
client = OpenAI()
resp = client.responses.create(
model="gpt-6-astra",
tools=[{
"type": "mcp",
"server_label": "isopleth",
"server_url": "https://api.isopleth.dev/mcp",
"authorization": os.environ["ISOPLETH_KEY"],
"require_approval": "never",
}],
input="What flood zone is 30.2672, -97.7431 in, and how far is the nearest substation?",
)
print(resp.output_text)pip install openai-agents
import asyncio, os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
async def main():
async with MCPServerStreamableHttp(
name="isopleth",
params={"url": "https://api.isopleth.dev/mcp",
"headers": {"Authorization": f"Bearer {os.environ['ISOPLETH_KEY']}"},
"timeout": 60},
client_session_timeout_seconds=120,
) as isopleth:
agent = Agent(name="Land analyst", instructions="Cite the source of every value.",
mcp_servers=[isopleth])
result = await Runner.run(agent, "Land read for 38.71, -98.92: slope, soils, flood zone.")
print(result.final_output)
asyncio.run(main())pip install anthropic. Claude's MCP connector calls Isopleth for you.
import os
import anthropic
client = anthropic.Anthropic()
msg = client.beta.messages.create(
model="claude-sonnet-5-5",
max_tokens=2000,
betas=["mcp-client-2025-11-20"],
mcp_servers=[{
"type": "url",
"name": "isopleth",
"url": "https://api.isopleth.dev/mcp",
"authorization_token": os.environ["ISOPLETH_KEY"],
}],
tools=[{"type": "mcp_toolset", "mcp_server_name": "isopleth"}],
messages=[{"role": "user", "content": "Power read for 35.0844, -106.6504."}],
)
print(msg.content[-1].text)pip install langchain langchain-mcp-adapters langchain-openai
import asyncio, os
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_agent
async def main():
client = MultiServerMCPClient({
"isopleth": {
"transport": "streamable_http",
"url": "https://api.isopleth.dev/mcp",
"headers": {"Authorization": f"Bearer {os.environ['ISOPLETH_KEY']}"},
}
})
tools = await client.get_tools()
agent = create_agent("openai:gpt-6-astra", tools)
out = await agent.ainvoke({"messages": [{"role": "user", "content": "Hazards read for 29.95, -90.07"}]})
print(out["messages"][-1].content)
asyncio.run(main())npm i ai @ai-sdk/mcp @ai-sdk/openai
import { createMCPClient } from "@ai-sdk/mcp";
import { generateText, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
const isopleth = await createMCPClient({
transport: {
type: "http",
url: "https://api.isopleth.dev/mcp",
headers: { Authorization: `Bearer ${process.env.ISOPLETH_KEY}` },
},
});
try {
const { text } = await generateText({
model: openai("gpt-6-astra"),
tools: await isopleth.tools(),
stopWhen: stepCountIs(8),
prompt: "Solar siting read for 35.08, -106.65. Cite sources.",
});
console.log(text);
} finally {
await isopleth.close();
}The hosted-tool snippets (OpenAI Responses, Claude API) let the model provider call
https://api.isopleth.dev/mcp for you, so your code never handles tool calls. The SDK snippets (Agents SDK, LangChain, Vercel
AI SDK) connect from your process and list Isopleth's 10 tools.
OpenAPI: GPT Actions, Postman and code generators
The full REST schema is at https://isopleth.dev/openapi.json (OpenAPI 3.1.0, CORS-enabled).
https://isopleth.dev/openapi.json
- Custom GPT (Actions): Configure → Create new action → Import from URL, paste the URL above. Set Authentication to API Key, Bearer, and paste your key.
- Postman: Import → paste the URL. Set the collection's Authorization to Bearer Token with
{{ISOPLETH_KEY}}. - Code generators:
npx openapi-typescript https://isopleth.dev/openapi.json -o isopleth.d.tsoropenapi-python-client generate --url https://isopleth.dev/openapi.json.
For coding agents
/llms.txt is a short, plain-text map of the API, the MCP server and the docs, for Cursor, Claude
Code, Codex and other agents that read it. Point your agent at it, or paste
Read https://isopleth.dev/llms.txt and wire Isopleth into this project.
Prefer an app?
Claude, ChatGPT, Cursor, VS Code, Claude Code and Codex connect without code: see MCP server.