Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getspine.ai/llms.txt

Use this file to discover all available pages before exploring further.

Codex CLI is OpenAI’s terminal-based coding agent. Give it a system prompt that includes Spine’s API pattern and it will delegate research-heavy tasks to Spine.

Install

Download the system-prompt snippet:
curl -o spine-codex-prompt.md \
  https://docs.getspine.ai/static/agent-files/spine.codex.md

Download system prompt

spine.codex.md — append to your Codex system prompt or project instructions
Then append it to your Codex system instructions, or paste it into your project’s AGENTS.md.

Set your API key

export SPINE_API_KEY="sk_spine_..."
Create a key at platform.getspine.ai/keys.

What it does

The system prompt teaches Codex:
  1. When to call Spine — multi-source research, deliverable generation, competitive analyses
  2. The two-step patternPOST /v1/run → poll GET /v1/run/{run_id}
  3. How to pick a template based on the deliverable type
  4. How to present resultsfinal_output text + artifact download links

Non-interactive / CI usage

Three one-time setup steps are required for unattended Codex invocation:
# 1. Register your OpenAI API key with Codex. The OPENAI_API_KEY env var
#    alone is not sufficient — Codex stores auth in its own keychain.
printenv OPENAI_API_KEY | codex login --with-api-key

# 2. Export your Spine key in the same shell Codex will run in.
export SPINE_API_KEY=sk_spine_...

# 3. (Optional) confirm Codex auth status:
codex login status
Then invoke:
codex exec \
  --json --skip-git-repo-check \
  --dangerously-bypass-approvals-and-sandbox \
  "Produce a deep-research memo on <topic> using Spine" \
  < /dev/null
  • --skip-git-repo-check is required when running outside a git repo; without it Codex refuses with Not inside a trusted directory.
  • --full-auto is tempting for automation but its sandbox blocks network — Codex cannot reach api.getspine.ai under that preset. Use --dangerously-bypass-approvals-and-sandbox or a custom sandbox policy that allows outbound HTTPS.
  • < /dev/null closes stdin; without it codex exec blocks waiting for additional input even when the prompt is passed as an argument.

Example

You: Create a market analysis of European fintech APIs and output as a slide deck

Codex: I'll use the Spine API with template=slides.

  curl -X POST https://api.getspine.ai/v1/run \
    -H "X-API-KEY: $SPINE_API_KEY" \
    -F "prompt=Market analysis of European fintech APIs" \
    -F "template=slides"

  [polling... completed in 14m 32s]

  Results:
  - European_Fintech_APIs.pptx → https://...
  - Credits consumed: 41
For long-running production workflows, register a webhook instead of polling — see Webhooks. Poll loops inside codex exec can exceed the turn budget for runs longer than 5–10 minutes.