# OpenAI Chat Completion Accomplish complex tasks like natural language processing, coding, translation, and creative writing with superior success using openai chat completion and its large context window. ## API Information - **Model Slug:** openai-chat-completion - **Branded URL:** https://www.eachlabs.ai/openai/gpt/openai-chat-completion - **Provider:** OpenAI - **Category:** Text to Text - **Output Type:** text - **Status:** active - **Version:** 0.0.1 - **Base Cost:** Default (gpt-4o): $2.625/1M input, $10.50/1M output - **Estimated Processing Time:** 1 seconds - **Last Updated:** 2026-06-01 - **Interactive Demo:** https://www.eachlabs.ai/ai-models/openai-chat-completion ## Pricing - **Charge Type:** dynamic - **Pricing Details:** Default (gpt-4o): $2.625/1M input, $10.50/1M output ### Pricing Rules | Condition | Pricing | | --- | --- | | model matches "gpt-5.4" | gpt-5.4: $2.625/1M input, $15.75/1M output | | model matches "gpt-5.4-mini" | gpt-5.4-mini: $0.7875/1M input, $4.725/1M output | | model matches "gpt-5.4-nano" | gpt-5.4-nano: $0.21/1M input, $1.3125/1M output | | model matches "gpt-5.2" | gpt-5.2: $1.8375/1M input, $14.70/1M output | | model matches "gpt-5.1" | gpt-5.1: $1.3125/1M input, $10.50/1M output | | model matches "gpt-5" | gpt-5: $1.3125/1M input, $10.50/1M output | | model matches "gpt-5-mini" | gpt-5-mini: $0.2625/1M input, $2.10/1M output | | model matches "gpt-5-nano" | gpt-5-nano: $0.0525/1M input, $0.42/1M output | | model matches "gpt-4.1" | gpt-4.1: $2.10/1M input, $8.40/1M output | | model matches "gpt-4.1-mini" | gpt-4.1-mini: $0.42/1M input, $1.68/1M output | | model matches "gpt-4.1-nano" | gpt-4.1-nano: $0.105/1M input, $0.42/1M output | | model matches "gpt-4o-mini" | gpt-4o-mini: $0.1575/1M input, $0.63/1M output | | model matches "o3" | o3: $2.10/1M input, $8.40/1M output | | model matches "o3-mini" | o3-mini: $1.155/1M input, $4.62/1M output | | model matches "o4-mini" | o4-mini: $1.155/1M input, $4.62/1M output | | Rule 16 | Default (gpt-4o): $2.625/1M input, $10.50/1M output | ## Input Schema | Parameter | Type | Required | Default | Constraints | Description | |-----------|------|----------|---------|-------------|-------------| | user_prompt | string | Yes | - | - | - | | image_url | string | No | - | - | - | | system_prompt | string | No | - | - | - | | model | string | Yes | gpt-4o | gpt-4.1,gpt-4.1-mini,gpt-4.1-nano,gpt-4o-mini,gpt-4o,gpt-5.1,gpt-5,gpt-5-mini,gpt-5-nano,o3-mini | - | | max_tokens | integer | No | - | - | - | ## Example Request ```bash curl -X POST https://api.eachlabs.ai/v1/prediction/ \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "openai-chat-completion", "input": { "model": "gpt-4o", "user_prompt": "Hello from EachAI!" } }' ``` ## Output Schema Response returned by `GET /v1/prediction/{id}` when the job completes: ```json { "status": "success", "predictionID": "string", "output": "text", "metrics": { "predict_time": "number (seconds)" } } ``` ## Polling ```bash curl https://api.eachlabs.ai/v1/prediction/{PREDICTION_ID} \ -H "X-API-Key: YOUR_API_KEY" ``` | Status | Meaning | |--------|---------| | `processing` | Still running — poll again | | `success` | Done — read `output` | | `error` | Failed — read `message` / `details` | ## Webhook (alternative to polling) Pass `"webhook_url": "https://your.host/path"` in the create request. Eachlabs POSTs this payload when the job ends: ```json { "exec_id": "prediction-uuid", "status": "succeeded", "output": "https://...", "error": "" } ``` `status` is `"succeeded"` or `"failed"`. `exec_id` equals the `predictionID` from create. Return 2xx within 30 seconds. ## Errors Error body: `{ "status": "error", "message": "...", "details": "..." }` | Code | Meaning | |------|---------| | `400` | Invalid input | | `401` | Missing / invalid `X-API-Key` | | `404` | Unknown model or prediction id | | `429` | Rate limit — 100 creates / min, 10 concurrent per key | | `5xx` | Retry with backoff | ## Overview **openai-chat-completion — Text-to-Text AI Model** Developed by OpenAI as part of the **gpt** family, **openai-chat-completion** empowers developers and creators to tackle complex tasks like natural language processing, coding, translation, and creative writing with exceptional accuracy and efficiency. This **text-to-text AI model** stands out with its massive context window—up to 1 million tokens in advanced variants like GPT-4.1-mini—enabling processing of entire documents or lengthy conversations without losing key details. Whether you're building **OpenAI chat completion API** integrations for chatbots or automating content generation, **openai-chat-completion** delivers superior performance for **OpenAI text-to-text** workflows, handling intricate prompts with precise, context-aware responses. ## Usage Notes - API Base URL: `https://api.eachlabs.ai/v1` - Authentication: send `X-API-Key: YOUR_API_KEY`. Generate a key from the Eachlabs dashboard at https://www.eachlabs.ai/dashboard/api-keys. - File-typed parameters (`*_url`, `image_url`, `video_url`, `audio_url`, etc.) accept publicly-reachable HTTPS URLs only. Upload your asset first (GCS / S3 / your CDN) and pass the resulting URL. Data-URIs and localhost URLs are rejected. - For structured parameters (arrays / objects) send real JSON values, not stringified payloads. - Monetary values are reported in USD; per-token / per-megapixel rates may be billed in micro-cents internally. - Prefer `webhook_url` over polling for long-running predictions — see the Webhook Callback section.