Skip to main content

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.

GPT-5.4 Mini and Nano -- Now Available

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

  1. Go to platform.openai.com
  2. Sign in or create an account
  3. Navigate to API Keys in the left sidebar
  4. Click Create new secret key
  5. Name the key (e.g., contract-lucidity-prod)
  6. Copy the key immediately -- it will not be shown again
Organisation Keys

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.

GPT-5.4 Nano -- Budget Powerhouse

PropertyValue
Model IDgpt-5.4-nano
Context Window128K tokens
Input Price$0.20 / 1M tokens
Output Price$1.25 / 1M tokens
APIResponses API
Best ForExtraction, 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

PropertyValue
Model IDgpt-5.4-mini
Context Window400K tokens
Input Price$0.75 / 1M tokens
Output Price$4.50 / 1M tokens
APIResponses API
Best ForDocument 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

PropertyValue
Model IDgpt-5.4
Context Window1M tokens
Input Price$2.50 / 1M tokens
Output Price$15.00 / 1M tokens
APIResponses API
Best ForComplex 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:

ModelInput PriceOutput PriceNotes
gpt-4o$1.25 / 1M$5.00 / 1MStill 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 / 1MCheapest 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 / 1MSuperseded by GPT-5.4 which offers better quality at the same or lower cost.

Reasoning Models

ModelInput PriceOutput PriceNotes
o3-mini$0.55 / 1M$2.20 / 1MChain-of-thought reasoning
o4-mini$0.55 / 1M$2.20 / 1MLatest 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

ModelDimensionsPrice (per 1M tokens)Best For
text-embedding-3-small1,536$0.02Recommended -- best value for contract retrieval
text-embedding-3-large3,072$0.13Higher precision for cross-document intelligence
Recommended Embedding Choice

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

  1. Navigate to Settings > AI Providers
  2. Click Add Provider
  3. Select OpenAI as the provider type
  4. Paste your API key
  5. Click Save & Verify

Option A: OpenAI Only (Recommended)

CapabilityModelRationale
Extraction & Classificationgpt-5.4-nanoFastest, cheapest, sufficient for classification
Document Understandinggpt-5.4-mini400K context, strong structured extraction
Reasoninggpt-5.4Best quality for risk analysis and recommendations
Generationgpt-5.4-miniGood quality at moderate cost
Embeddingstext-embedding-3-smallBest value for contract retrieval

Option B: Hybrid (Anthropic + OpenAI Embeddings)

CapabilityProviderModel
Extraction & ClassificationAnthropicclaude-sonnet-4-20250514
Document UnderstandingAnthropicclaude-sonnet-4-20250514
ReasoningAnthropicclaude-opus-4-20250514
GenerationAnthropicclaude-sonnet-4-20250514
EmbeddingsOpenAItext-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 RangeReasoning EffortCL Pipeline Usage
0.0 -- 0.2lowClassification, extraction (deterministic)
0.3 -- 0.5mediumClause analysis, structured extraction
0.6 -- 1.0highCreative 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:

CapabilityModelEst. Monthly Cost
Extraction & Classificationgpt-5.4-nano~$2
Document Understanding + Generationgpt-5.4-mini~$50
Reasoning (reports)gpt-5.4~$80
Embeddingstext-embedding-3-small~$5
Total~$137/month

Cost Comparison by Volume

VolumeDocuments/MonthAvg PagesEst. Cost (GPT-5.4 Family)Est. Cost (Legacy GPT-4o)
Small firm5015~$15~$20
Mid-size20020~$55~$105
Mid-size+50020~$137~$260
Am Law 2001,00025~$275~$585
Am Law 1005,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:

TierSpend RequiredRPM (GPT-5.4)TPM (GPT-5.4)
Tier 1$51,000500,000
Tier 2$505,0001,000,000
Tier 3$1005,0002,000,000
Tier 4$25010,0004,000,000
Tier 5$1,00010,00010,000,000
info

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

SymptomCauseSolution
401 UnauthorizedInvalid API keyRegenerate at platform.openai.com
429 Rate limit exceededToo many requestsWait 60s and retry, or upgrade tier
model_not_foundModel ID typo or model not availableVerify exact model ID (e.g., gpt-5.4-mini, not gpt5.4-mini)
unsupported parameter: reasoningModel does not support reasoning paramCL handles this automatically via fallback -- check logs for other errors
Embeddings return wrong dimensionsModel mismatchEnsure you are using text-embedding-3-small (1536d) or text-embedding-3-large (3072d)
Responses API errors for GPT-5.xSDK version too oldEnsure openai>=1.30 is installed in the backend container