3P API × Clay — Setup Card

Your prompt goes in a column. Never in the JSON.

Two ways to run it. Option A (recommended): write plain English in a Prompt column — works exactly like Claygent, impossible to break. Option B: write the prompt directly inside the Body — fine, as long as you follow four formatting rules every time.

Option A · recommended

Write your prompt in the Prompt column

a normal text column — the only thing you ever edit
app.clay.com / workspaces / … / your-table
# TCompany Name 🔗Website TPrompt {}3P API Writer ƒOutput
1 Brightline Labs brightlinelabs.com Write one sentence starting with "target"… 200 · Success Target the VP of Operations at Brightline…
2 Northgate HVAC northgatehvac.com Write one sentence starting with "target"… 200 · Success Target the owner-operator at Northgate…
3 Cobalt Analytics cobaltanalytics.io Write one sentence starting with "target"… queued…
4Harborview Mediaharborview.media
5Fernwell Goodsfernwell.co
Prompt — row 1esc to close
Write one sentence starting with "target" describing who we should reach out to at this company. Company: Company Name
Website: Website Reply with ONLY the sentence.
you just type here — plain English
quotes ✓  blank lines ✓  type “/” to insert a column ✓
Option A · recommended

The 3P API column is set up once — then frozen

HTTP API column settings · nobody types prose in here, ever
app.clay.com / … / column settings — 3P API Writer
# TCompany Name TPrompt {}3P API Writer
1Brightline LabsWrite one sentence starting with "target" describing…200 · Success
2Northgate HVACWrite one sentence starting with "target" describing…200 · Success
3Cobalt AnalyticsWrite one sentence starting with "target" describing…queued…
4Harborview Media
5Fernwell Goods
6Juniper & Co.
HTTP API 3P API Writer
POST
https://api.tokenmarket.workers.dev/v1/chat/completions
3P API Gateway
paste once · never edit
{ "model": "gpt-4o-mini", "messages": [{ "role": "user", "content": "Prompt" }], "temperature": 0 }
Save
we paste this once, then hands off
the Prompt chip (inserted with “/”) sits inside the quotes — Clay escapes it automatically
Option B · careful mode b

Or: write the prompt directly in the Body

no extra column — but the formatting rules are on you

Method, Endpoint and Account: identical to Option A above — only the Body differs. Spacing the JSON out across lines is fine; the only Enter key that breaks things is one inside your prompt text.

The template
{ "model": "gpt-4o-mini", "messages": [{ "role": "user", "content": "your prompt goes here" }], "temperature": 0 }
swap the green bit for your prompt — nothing else moves
Filled in — a real example
{ "model": "gpt-4o-mini", "messages": [{ "role": "user", "content": "Write one sentence starting with 'target' describing who we should reach out to at this company. Company: Company Name. Website: Website. Reply with ONLY the sentence." }], "temperature": 0 }
long prompt wraps on screen — that's fine, no Enter was pressed
1Inside your prompt use single quotes 'like this' — a raw "double quote" ends the JSON string early and the call dies.
2Never press Enter inside the prompt text. Write flowing sentences; let it wrap on its own.
3Insert columns by typing / — they drop in as blue chips. Don't hand-type {{Column Name}} as text.
4Only edit the prompt between the quotes — leave the JSON skeleton around it alone.
💡 Shortcut: write your prompt in ChatGPT/Claude first if you like — just paste the finished text into the content slot, then re-insert the column chips with /.
!

The cardinal rule — both options: the Body must never end up with a raw " or a line break inside the prompt text. Option A makes that impossible (the Prompt chip is escaped automatically — just don't replace it with prose). Option B is fine only if you follow the four rules every single edit — skip one and you're back to "Failed to parse body input".

Pull the clean text out of the noisy response

one click — no formula needed
3P API Writer — row 1 · responseStatus Code: 200
{ "id": "chatcmpl-9xKf…", "object": "chat.completion", "model": "gpt-4o-mini", "choices": [{ "message": { "role": "assistant", "content": "Target the VP of Operations at Brightline Labs…" + Add as column } }], "usage": { "total_tokens": 96, … } }

Everything except one field is noise

The API answers with its full technical envelope — IDs, model info, token counts. The sentence you asked for lives in one field: choices → 0 → message → content.

Click any cell in the 3P API column to open the response, find content, hover it and hit Add as column. Name it Output. That's it — done once, it fills for every row, and your table shows just the clean sentence from then on.

New column? It plays dead until you force-run it

Why this step exists

Clay doesn't mark a brand-new column's cells as "stale," so a normal run skips them all and the column just sits there blank. It's not broken — it needs one forced run.

Click the on the 3P API column header → Run columnForce run all. You'll know it worked when you see:

Status Code: 200 ✓  + text in your Output column

Why this can't break

The old failure: prompt text lived inside the JSON, so every quote mark and line break had to obey JSON escaping rules — and Clay un-escapes one layer before sending, which is why hand-typed bodies kept dying with Failed to parse body input. In this setup your prompt travels as data: the Prompt chip is wrapped in Clay's escaping function under the hood, so it's escaped perfectly, automatically, on every row — no human ever types inside the JSON, same reason Claygent's prompt box never breaks. (Live-verified: a prompt containing double quotes and line breaks came back 200 with clean output.) Option B works too — but there the prose sits inside the JSON, so the rules (single quotes, no Enter, chips via /) are on you every edit. That's the whole trade.