# chat-latest > LLM model from openai, available via Core.Today API. - **Provider**: openai - **Model ID**: chat-latest - **Category**: chat - **Pricing Type**: token_based - **Billing**: per token — see Token Pricing ## API Endpoint Base URL: https://api.core.today ### Chat Completions POST /llm/openai/v1/chat/completions ## Authentication Header: `Authorization: Bearer YOUR_API_KEY` Note: Your Core.Today API key (`cdt_xxx`) works as Bearer token. ## Input Parameters - `model` (string, **required**): Model identifier. Use `chat-latest` - `messages` (array, **required**): Array of message objects with `role` and `content` - `temperature` (number, optional): Sampling temperature (Default: `1.0`; Range: min: 0, max: 2) - `max_tokens` (integer, optional): Maximum tokens to generate - `stream` (boolean, optional): Enable streaming responses (Default: `false`) - `top_p` (number, optional): Nucleus sampling parameter (Default: `1.0`) ## Example Request ```json { "model": "chat-latest", "messages": [ { "role": "user", "content": "Hello, how are you?" } ] } ``` ## Response Format ```json { "id": "chatcmpl-abc123", "object": "chat.completion", "model": "chat-latest", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Response text here" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 20, "total_tokens": 30 } } ``` ## Usage Flow 1. POST /llm/openai/v1/chat/completions with model and messages 2. Response is returned synchronously (or streamed if stream=true) 3. Credits are deducted based on token usage Credits in the response (opt-in): send the header `X-Coredot-Include-Cost: true` and the response reports the credits that call is billed — `usage.coredot.credits` in the body (Gemini: `usageMetadata.coredot`; streaming: in the final usage event) and, for non-streaming responses, the `X-Coredot-Credits` header. Guide: https://console.core.today/llms/api.txt (section "Credits in the response"). ## Token Pricing - Input: 0.00929 credits/token (9,290 credits per 1M tokens) - Cached Input: 0.000929 credits/token (929 credits per 1M tokens) - Cache Write: 0.0116125 credits/token (11,612.5 credits per 1M tokens) - Image Input: 0.00929 credits/token (charged at the Input rate) - Output: 0.05574 credits/token (55,740 credits per 1M tokens) - Web Search: 18.58 credits per request (built-in web search tool) ## Image Input This model accepts images as input. Image bytes are converted to tokens by the upstream provider and charged at the standard Input rate (0.00929 credits/token). **Tokenization**: tile-based - Tokens per image ≈ `85 + 170 × tiles` (each tile = 512×512px after scaling) - Notes: low=85 fixed; high=85 + 170×tiles after scaling to 2048 max then 768 short edge ### Example (OpenAI-compatible) ```json { "model": "chat-latest", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What's in this image?" }, { "type": "image_url", "image_url": { "url": "https://example.com/image.jpg" } } ] } ] } ``` ## Tags openai, chat