OpenAI Codex
OpenAI Codex Quickstart
Add TauFunctions to AGENTS.md and deploy serverless functions from inside the Codex sandbox.
Codex sandbox notes:
- The Codex sandbox has no persistent state between sessions. Store function IDs externally or re-list them.
- Network access is enabled — curl commands to taufunctions.com work inside the sandbox.
- Use environment variables (
$TF_API_KEY) rather than hardcoding keys in code files. - Set env vars at the top of each session or in your Codex task configuration.
Step 1. Get your API key
curl -s -X POST https://taufunctions.com/api/signup \
-H "Content-Type: application/json" \
-d '{"tenantId":"my-project","agent":"codex"}' | jq .In your Codex session, set the env vars:
export TF_BASE_URL=https://taufunctions.com export TF_API_KEY=tf_free_YOUR_KEY_HERE
Also add to your project .env for reference:
# .env TF_BASE_URL=https://taufunctions.com TF_API_KEY=tf_free_YOUR_KEY_HERE
Step 2. Add to AGENTS.md
Create or append to AGENTS.md in your project root. Codex reads this file for agent instructions.
# TauFunctions — Serverless Functions API
## Environment
- TF_BASE_URL=https://taufunctions.com
- TF_API_KEY is in .env (export it at session start: export TF_API_KEY=...)
## Auth
All requests need: Authorization: Bearer $TF_API_KEY
## Endpoints
- POST $TF_BASE_URL/saas/api/v1/sdk/tau/functions — Create function
- GET $TF_BASE_URL/saas/api/v1/sdk/tau/functions — List functions
- GET $TF_BASE_URL/saas/api/v1/sdk/tau/functions/:id — Get function
- PUT $TF_BASE_URL/saas/api/v1/sdk/tau/functions/:id — Update function
- DELETE $TF_BASE_URL/saas/api/v1/sdk/tau/functions/:id — Delete function
- POST $TF_BASE_URL/saas/api/v1/sdk/tau/functions/:id/deploy — Deploy function
- POST $TF_BASE_URL/saas/api/v1/sdk/tau/functions/:id/invoke — Invoke function
- GET $TF_BASE_URL/saas/api/v1/sdk/tau/functions/:id/stats — Get stats
- GET $TF_BASE_URL/saas/api/v1/sdk/tau/functions/:id/logs — Get logs
- GET $TF_BASE_URL/saas/api/v1/sdk/tau/runtimes — List runtimes
## Create Function Body
{
"name": "function-name",
"runtime": "nodejs20", // nodejs18, nodejs20, nodejs22, python3.11, python3.12
"handler": "index.handler",
"code": "module.exports.handler = async (event) => { ... }",
"trigger": "http" // http, cron, event, webhook, manual
}
## Invoke Body
{ "payload": { "key": "value" } }
## Free Plan: 10 functions, 100 invocations/day, 1 API key
## Sandbox Notes
- No persistent state between sessions — re-list functions to get IDs
- Network access is enabled — curl works
- Export TF_API_KEY at session start
- Do not hardcode API keys in source files
## Workflow: Create -> Deploy -> Invoke -> Check stats/logsStep 3. Create a function
curl -s -X POST https://taufunctions.com/saas/api/v1/sdk/tau/functions \
-H "Authorization: Bearer $TF_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "hello-world",
"runtime": "nodejs20",
"handler": "index.handler",
"code": "module.exports.handler = async (event) => { return { statusCode: 200, body: JSON.stringify({ message: \"Hello from TauFunctions!\" }) }; }",
"trigger": "http"
}' | jq .Save the returned id. In Codex, you can store it in a variable:
FN_ID=$(curl -s -X POST https://taufunctions.com/saas/api/v1/sdk/tau/functions \
-H "Authorization: Bearer $TF_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "hello-world",
"runtime": "nodejs20",
"handler": "index.handler",
"code": "module.exports.handler = async (event) => { return { statusCode: 200, body: JSON.stringify({ message: \"Hello from TauFunctions!\" }) }; }",
"trigger": "http"
}' | jq -r '.id')
echo "Function ID: $FN_ID"Step 4. Deploy the function
curl -s -X POST https://taufunctions.com/saas/api/v1/sdk/tau/functions/$FN_ID/deploy \ -H "Authorization: Bearer $TF_API_KEY" | jq .
Step 5. Invoke with a JSON payload
curl -s -X POST https://taufunctions.com/saas/api/v1/sdk/tau/functions/$FN_ID/invoke \
-H "Authorization: Bearer $TF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"payload":{"name":"World"}}' | jq .Step 6. View stats and logs
# Stats curl -s https://taufunctions.com/saas/api/v1/sdk/tau/functions/$FN_ID/stats \ -H "Authorization: Bearer $TF_API_KEY" | jq . # Logs curl -s https://taufunctions.com/saas/api/v1/sdk/tau/functions/$FN_ID/logs \ -H "Authorization: Bearer $TF_API_KEY" | jq .
Step 7. Try Python runtime
# Create
PY_FN_ID=$(curl -s -X POST https://taufunctions.com/saas/api/v1/sdk/tau/functions \
-H "Authorization: Bearer $TF_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "py-hello",
"runtime": "python3.12",
"handler": "handler.main",
"code": "def main(event):\n name = event.get(\"name\", \"World\")\n return {\"statusCode\": 200, \"body\": f\"Hello, {name}! From Python.\"}",
"trigger": "http"
}' | jq -r '.id')
echo "Python Function ID: $PY_FN_ID"
# Deploy
curl -s -X POST https://taufunctions.com/saas/api/v1/sdk/tau/functions/$PY_FN_ID/deploy \
-H "Authorization: Bearer $TF_API_KEY" | jq .
# Invoke
curl -s -X POST https://taufunctions.com/saas/api/v1/sdk/tau/functions/$PY_FN_ID/invoke \
-H "Authorization: Bearer $TF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"payload":{"name":"Codex Agent"}}' | jq .Step 8. Free plan limits
| Resource | Free Plan |
|---|---|
| Functions | 10 |
| Invocations / day | 100 |
| API keys | 1 |
| Runtimes | All (Node.js 18/20/22, Python 3.11/3.12) |
Check limits: curl -s https://taufunctions.com/api/signup/limits | jq .
Need more? Contact support@taufunctions.com to upgrade.