← Fable Drop

Run an OpenAI Agents SDK agent on credit bought with SOL

Run an OpenAI Agents SDK agent on fable-5.2-high with credit bought in SOL. The client setup for the SDK's default Responses route, with function tools and streaming.

What you need

A Python project on the OpenAI Agents SDK (openai-agents) and an API key from this gateway. Each payment gets 20x its dollar value as API credit for fable-5.2-high, charged at $8 per million input tokens and $40 per million output tokens. The minimum is 0.01 SOL.

Get a key

Ask for a quote, send the quoted SOL, report the transaction signature and poll the claim. The key arrives once the payment is approved. Each payment is approved by the operator by hand, so the key is not instant.

curl -s -X POST https://fable-drop-nine.vercel.app/v1/quote \
  -H "content-type: application/json" \
  -d '{"amount_sol": 0.1}'

Point the SDK at the gateway

The SDK calls the Responses API by default, which this gateway serves for text, function tools and streaming. Turn tracing off, because traces are uploaded to OpenAI with an OpenAI key.

from openai import AsyncOpenAI
from agents import Agent, Runner, function_tool, set_default_openai_client, set_tracing_disabled

set_tracing_disabled(True)
set_default_openai_client(AsyncOpenAI(base_url="https://fable-drop-nine.vercel.app/v1", api_key="<api_key>"))

@function_tool
def weather(city: str) -> str:
    """Weather for a city."""
    return "sunny"

agent = Agent(name="Helper", instructions="Be brief.", model="fable-5.2-high", tools=[weather])
result = await Runner.run(agent, "What is the weather in Pune?")
print(result.final_output)

What is not supported

Nothing is stored between calls, so previous_response_id and server-side conversations return an error; the SDK sends the whole run each turn by default, which works. Hosted tools such as web search, file search and code interpreter are not available. Images need /v1/messages.

Check the setup before paying

Use the API key fable-test. It returns a fixed reply in the real response format without calling the model and at no cost, so you can confirm the base URL first.

How this was checked

openai-agents 0.26.0 was run against a local copy of this gateway with a simulated model: Runner.run and Runner.run_streamed each completed a function tool round trip over the Responses route. Real model answers were not run, so start with a small payment.

Track what is left

A script or the agent can read remaining credit and top up before it runs out.

curl -s https://fable-drop-nine.vercel.app/v1/balance -H "x-api-key: <api_key>"
Pay to 5pgexa… and get 20x credit