OpenAI (GPT)
OpenAI models are a fully supported alternative to Anthropic for all CL capabilities. OpenAI is particularly recommended for embeddings (text-embedding-3 family) and is a strong choice for organisations already invested in the OpenAI ecosystem.
On March 17, 2026, OpenAI released GPT-5.4 mini and GPT-5.4 nano -- two new models that dramatically improve the price/performance ratio for contract analysis workloads. See OpenAI's announcement and independent benchmarks for details.
CL fully supports these models with no code changes required -- the AI client automatically routes GPT-5.x models through the Responses API.
Getting an API Key
- Go to platform.openai.com
- Sign in or create an account
- Navigate to API Keys in the left sidebar
- Click Create new secret key
- Name the key (e.g.,
contract-lucidity-prod) - Copy the key immediately -- it will not be shown again
If your OpenAI account belongs to an organisation, ensure the key is scoped to the correct org. CL sends all requests using the single API key configured in the provider settings.
Recommended Models
GPT-5.4 Nano -- Budget Powerhouse
| Property | Value |
|---|---|
| Model ID | gpt-5.4-nano |
| Context Window | 128K tokens |
| Input Price | $0.20 / 1M tokens |
| Output Price | $1.25 / 1M tokens |
| API | Responses API |
| Best For | Extraction, classification, high-volume processing |
GPT-5.4 nano is the fastest and cheapest GPT-5 class model. At $0.20/M input tokens it is 6x cheaper than GPT-4o ($1.25/M) while delivering comparable quality for extraction and classification tasks. This is the new default recommendation for high-volume pipelines.
GPT-5.4 Mini -- Best All-Rounder
| Property | Value |
|---|---|
| Model ID | gpt-5.4-mini |
| Context Window | 400K tokens |
| Input Price | $0.75 / 1M tokens |
| Output Price | $4.50 / 1M tokens |
| API | Responses API |
| Best For | Document understanding, generation, structured extraction |
GPT-5.4 mini offers a 400K context window and strong document comprehension at a moderate price. It is 2x faster than GPT-5 mini and excels at structured extraction and clause draft generation. The large context window makes it ideal for analysing lengthy agreements without chunking.
GPT-5.4 -- Premium Reasoning
| Property | Value |
|---|---|
| Model ID | gpt-5.4 |
| Context Window | 1M tokens |
| Input Price | $2.50 / 1M tokens |
| Output Price | $15.00 / 1M tokens |
| API | Responses API |
| Best For | Complex reasoning, risk analysis, report generation |
GPT-5.4 is the full-power model, best suited for CL's Reasoning capability where quality of risk analysis and recommendations matters most. Use this for report generation and complex multi-factor assessments.
Legacy Models
These models remain available but are no longer the primary recommendation:
| Model | Input Price | Output Price | Notes |
|---|---|---|---|
gpt-4o | $1.25 / 1M | $5.00 / 1M | Still capable; uses Chat Completions API. Consider migrating to gpt-5.4-nano for extraction or gpt-5.4-mini for understanding tasks. |
gpt-4o-mini | $0.15 / 1M | $0.60 / 1M | Cheapest overall on input tokens. Uses Chat Completions API. Suitable if you need the absolute lowest per-token cost and can accept older-generation quality. |
gpt-5 | $1.25 / 1M | $10.00 / 1M | Superseded by GPT-5.4 which offers better quality at the same or lower cost. |
Reasoning Models
| Model | Input Price | Output Price | Notes |
|---|---|---|---|
o3-mini | $0.55 / 1M | $2.20 / 1M | Chain-of-thought reasoning |
o4-mini | $0.55 / 1M | $2.20 / 1M | Latest reasoning model |
Reasoning models (o-series) use the Responses API with explicit chain-of-thought. CL supports these but they are generally not needed for contract analysis -- GPT-5.4 provides sufficient reasoning capability without the overhead.
Embedding Models
| Model | Dimensions | Price (per 1M tokens) | Best For |
|---|---|---|---|
text-embedding-3-small | 1,536 | $0.02 | Recommended -- best value for contract retrieval |
text-embedding-3-large | 3,072 | $0.13 | Higher precision for cross-document intelligence |
text-embedding-3-small is the recommended default. At $0.02 per million tokens, embedding an entire 50-page contract costs less than $0.001. The quality difference versus text-embedding-3-large is negligible for clause-level retrieval in legal documents.
Configuration in Contract Lucidity
Adding OpenAI as a Provider
- Navigate to Settings > AI Providers
- Click Add Provider
- Select OpenAI as the provider type
- Paste your API key
- Click Save & Verify
Recommended Capability Mapping
Option A: OpenAI Only (Recommended)
| Capability | Model | Rationale |
|---|---|---|
| Extraction & Classification | gpt-5.4-nano | Fastest, cheapest, sufficient for classification |
| Document Understanding | gpt-5.4-mini | 400K context, strong structured extraction |
| Reasoning | gpt-5.4 | Best quality for risk analysis and recommendations |
| Generation | gpt-5.4-mini | Good quality at moderate cost |
| Embeddings | text-embedding-3-small | Best value for contract retrieval |
Option B: Hybrid (Anthropic + OpenAI Embeddings)
| Capability | Provider | Model |
|---|---|---|
| Extraction & Classification | Anthropic | claude-sonnet-4-20250514 |
| Document Understanding | Anthropic | claude-sonnet-4-20250514 |
| Reasoning | Anthropic | claude-opus-4-20250514 |
| Generation | Anthropic | claude-sonnet-4-20250514 |
| Embeddings | OpenAI | text-embedding-3-small |
This hybrid configuration uses Claude for all text generation tasks and OpenAI exclusively for embeddings, combining best-in-class legal analysis with the lowest-cost embedding option.
GPT-5 and o-Series Model Details
CL automatically detects models that require the Responses API by checking for these patterns in the model name:
gpt-5(all GPT-5 and GPT-5.x variants including nano, mini, pro)o1(o1-preview, o1-mini)o3(o3, o3-mini)o4(o4-mini)
Temperature to Reasoning Effort Mapping
Since GPT-5.x and o-series models do not support the temperature parameter, CL converts it to a reasoning_effort level:
| Temperature Range | Reasoning Effort | CL Pipeline Usage |
|---|---|---|
| 0.0 -- 0.2 | low | Classification, extraction (deterministic) |
| 0.3 -- 0.5 | medium | Clause analysis, structured extraction |
| 0.6 -- 1.0 | high | Creative generation, complex reasoning |
For contract analysis, CL typically uses temperatures of 0.0 -- 0.2, which maps to low reasoning effort -- producing thorough, accurate results optimised for precision over creativity.
Cost Considerations
Estimating Monthly Spend (GPT-5.4 Family)
For a mid-size firm processing 500 documents/month averaging 20 pages each:
| Capability | Model | Est. Monthly Cost |
|---|---|---|
| Extraction & Classification | gpt-5.4-nano | ~$2 |
| Document Understanding + Generation | gpt-5.4-mini | ~$50 |
| Reasoning (reports) | gpt-5.4 | ~$80 |
| Embeddings | text-embedding-3-small | ~$5 |
| Total | ~$137/month |
Cost Comparison by Volume
| Volume | Documents/Month | Avg Pages | Est. Cost (GPT-5.4 Family) | Est. Cost (Legacy GPT-4o) |
|---|---|---|---|---|
| Small firm | 50 | 15 | ~$15 | ~$20 |
| Mid-size | 200 | 20 | ~$55 | ~$105 |
| Mid-size+ | 500 | 20 | ~$137 | ~$260 |
| Am Law 200 | 1,000 | 25 | ~$275 | ~$585 |
| Am Law 100 | 5,000+ | 30 | ~$1,400 | ~$3,500 |
The GPT-5.4 family delivers 50--60% cost savings compared to a GPT-4o-based configuration, while providing equal or better quality across all capabilities.
OpenAI Batch API
OpenAI offers a Batch API with 50% cost savings for asynchronous processing. At batch pricing:
- GPT-5.4 nano: $0.10 / 1M input tokens
- GPT-5.4 mini: $0.375 / 1M input tokens
- GPT-5.4: $1.25 / 1M input tokens
CL does not currently use the Batch API, but it is on the roadmap for high-volume deployments.
Rate Limits
OpenAI uses a tiered system based on cumulative spend:
| Tier | Spend Required | RPM (GPT-5.4) | TPM (GPT-5.4) |
|---|---|---|---|
| Tier 1 | $5 | 1,000 | 500,000 |
| Tier 2 | $50 | 5,000 | 1,000,000 |
| Tier 3 | $100 | 5,000 | 2,000,000 |
| Tier 4 | $250 | 10,000 | 4,000,000 |
| Tier 5 | $1,000 | 10,000 | 10,000,000 |
OpenAI's rate limits are generally more generous than Anthropic's at equivalent spend levels. GPT-5.4's increased TPM limits at Tier 1 (500K) make it viable for production use even on a new account.
Troubleshooting
| Symptom | Cause | Solution |
|---|---|---|
401 Unauthorized | Invalid API key | Regenerate at platform.openai.com |
429 Rate limit exceeded | Too many requests | Wait 60s and retry, or upgrade tier |
model_not_found | Model ID typo or model not available | Verify exact model ID (e.g., gpt-5.4-mini, not gpt5.4-mini) |
unsupported parameter: reasoning | Model does not support reasoning param | CL handles this automatically via fallback -- check logs for other errors |
| Embeddings return wrong dimensions | Model mismatch | Ensure you are using text-embedding-3-small (1536d) or text-embedding-3-large (3072d) |
| Responses API errors for GPT-5.x | SDK version too old | Ensure openai>=1.30 is installed in the backend container |