Firma lets you add legally binding e-signatures to anything built on OpenAI. Use the Responses API’s function calling to let your AI agents send signing requests on demand, connect Firma’s MCP servers to Codex CLI so the AI generates accurate integration code, or add Firma as a ChatGPT connector so you can manage signing requests from the ChatGPT desktop app.Documentation Index
Fetch the complete documentation index at: https://docs.firma.dev/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A Firma account with an API key
- An OpenAI API key (for function calling), or a ChatGPT Plus/Pro/Enterprise account (for Codex CLI and connectors)
- At least one Firma template with signing fields configured
Firma uses the raw API key as the
Authorization header value - do not prefix it with Bearer. This differs from the OpenAI API itself, which uses Bearer tokens.Getting started
- Function calling
- Codex CLI via MCP
- ChatGPT connectors
Function calling lets a GPT model decide when to call your code. You declare a function the model can call, and when the user asks it to send a contract, the model returns a structured tool call that your app executes against the Firma API.This path is the right fit for AI agents, chatbots, and any app where a natural-language user request should turn into a signing request.A user message like “Send the consulting agreement to alice@acme.com” will trigger the function call.
Step 1: Store your API keys
Keep both your OpenAI API key and your Firma API key in environment variables. Never put them in frontend code.Step 2: Declare a function and handle tool calls
Using the OpenAI Responses API (recommended for new projects):The
create-and-send endpoint creates the signing request and sends it to recipients in a single API call. If you need the model to draft a request for review before sending, use POST /signing-requests to create a draft, then POST /signing-requests/{id}/send once approved.Step 3: Wire it into your app
CallhandleUserMessage from your backend whenever the user sends a chat message:Python alternative
The same flow with the Python SDK:Webhook integration
To track signing events in real time, register a Firma webhook pointing at an endpoint in your app:Embedded signing
For apps where signers complete documents inside your UI instead of opening a Firma-hosted page, thecreate-and-send response includes first_signer.id (the signing_request_user_id) and a ready-made first_signer.signing_link. Load the signer URL in an iframe:
Tips
- Use function calling for runtime agents, MCP for build time. Function calling is what your deployed app uses to send documents. The MCP servers are what you and Codex CLI use to build that integration.
- Pass
template_idas a tool arg, not a free-form string. Templates are the safest way to constrain what the model can send. - Validate before sending. For higher-stakes documents, use
POST /signing-requeststo create a draft, surface it to the user, then callPOST /signing-requests/{id}/sendonly after they confirm. - Workspaces for multi-tenant apps. If you are building a SaaS product on top of the OpenAI API, give each end customer their own Firma workspace so templates and usage stay isolated.
Next steps
- API authentication - API keys and workspace scoping
- Webhooks guide - Event types, payloads, and signature verification
- Embedded signing - In-app signing experience
- Creating workspaces - Multi-tenant setups for SaaS apps
- MCP integration - Full MCP server reference with all 84 tools
- Complete setup guide - End-to-end Firma integration walkthrough
- API reference - Full endpoint documentation