@cartanova/qgrid-ai-sdk 2.9.2 → 2.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +25 -8
- package/README.md +49 -8
- package/dist/index.d.ts +28 -3
- package/dist/index.js +38 -18
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -204,14 +204,14 @@ const { text } = await generateText({
|
|
|
204
204
|
| `tokenName` | provider prefix를 포함한 토큰 이름 | 공통 | `anthropic/yds`처럼 활성 토큰 하나를 엄격히 지정. prefix는 model provider와 같아야 하며 빈 값·누락·inactive·quota 초과 시 다른 토큰으로 fallback하지 않음 |
|
|
205
205
|
| `logger` | `boolean` | 공통 | qgrid request log 저장 여부. 기본값은 `true`. `false`로 설정해도 client tool 실행과 multi-step 연결은 계속 동작 |
|
|
206
206
|
| `sessionKey` | `string` | OpenAI 전용 | 전체 history 재전송 시 불투명 prompt-cache affinity를 파생하는 멀티턴 대화 식별자 ([아래](#멀티턴-prompt-cache-sessionkey) 참조) |
|
|
207
|
-
| `effort` | OpenAI: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` \| `"ultra"` | OpenAI 전용 (`QgridOpenAIProviderOptions`) | ChatGPT 구독 Codex 경로의 reasoning 깊이. `"
|
|
207
|
+
| `effort` | OpenAI: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` \| `"ultra"` | OpenAI 전용 (`QgridOpenAIProviderOptions`) | ChatGPT 구독 Codex 경로의 reasoning 깊이. GPT-6 Astra와 GPT-5.6 Sol/Terra는 `"ultra"`까지, GPT-5.6 Luna는 `"max"`까지 지원하며, 모델이 지원하지 않는 값은 서버가 조용히 무시하고 백엔드 기본값을 적용. 공개 OpenAI API의 `"none"`/`"minimal"`은 이 경로에 없음 |
|
|
208
208
|
| `effort` | Anthropic: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` | Anthropic 전용 (`QgridAnthropicProviderOptions`) | Claude Code `--effort` 허용값. 집합 밖의 값은 서버가 조용히 무시하고 qgrid 기본(`"low"`)을 적용. 모델별 상한(예: Sonnet 4.6은 `"xhigh"` 없음)은 Claude Code가 처리 |
|
|
209
209
|
| `verbosity` | `"low"` \| `"medium"` \| `"high"` | OpenAI 전용 | 응답 텍스트의 상세도 |
|
|
210
210
|
| `reasoningSummary` | `"auto"` \| `"concise"` \| `"detailed"` \| `"none"` | OpenAI 전용 | 추론 요약 출력 방식 |
|
|
211
211
|
| `serviceTier` | `string` | OpenAI 전용 | OpenAI/codex service tier |
|
|
212
212
|
| `timeoutMs` | 양의 정수, 최대 `1_800_000` | Anthropic 전용 | 서버의 Claude Code 프로세스 제한시간(ms). SDK의 non-stream HTTP 제한은 이 값보다 60초 길게 설정. 기본값은 240초 |
|
|
213
213
|
| `imageGeneration` | `boolean` | OpenAI 전용, non-stream | codex 내장 `image_generation` tool 활성화 ([아래](#image-generation) 참조) |
|
|
214
|
-
| `imageGenerationOptions` | `{ quality?, size? }` | OpenAI 전용 | 이미지
|
|
214
|
+
| `imageGenerationOptions` | `{ quality?, size?, background? }` | OpenAI 전용 | 이미지 생성 옵션. `background: "transparent"`는 전용 경로 사용. 실제 크기·품질은 응답 metadata 확인 ([아래](#image-generation)). |
|
|
215
215
|
| `fallbackModels` | `string[]` | 예약 | 향후 qgrid 서버 fallback routing용 예약 필드. 현재 동작하지 않으며 Claude Code의 Fable refusal fallback과 무관 |
|
|
216
216
|
|
|
217
217
|
```typescript
|
|
@@ -252,7 +252,7 @@ const { text } = await generateText({
|
|
|
252
252
|
|
|
253
253
|
### Image Generation
|
|
254
254
|
|
|
255
|
-
OpenAI/codex 경로 전용, `generateText` 전용입니다.
|
|
255
|
+
OpenAI/codex 경로 전용, `generateText` 전용입니다. 요청별로 이미지 생성을 활성화하고 결과를 AI SDK `files`로 받습니다. 투명 배경은 Codex 전용 Images 경로를, 그 외에는 내장 `image_generation` 도구를 사용합니다.
|
|
256
256
|
|
|
257
257
|
```typescript
|
|
258
258
|
const result = await generateText({
|
|
@@ -291,6 +291,12 @@ const result = await generateText({
|
|
|
291
291
|
- 이미지 생성 요청은 provider 대화 상태를 보관하지 않고 전체 input을 직접 전송합니다.
|
|
292
292
|
- 레퍼런스 이미지는 JSON data URL로 전송됩니다. 큰 사진은 압축하거나 리사이즈해서 전달하세요. 과도하게 큰 base64 입력은 SDK가 거부하며, 사진에는 WebP/JPEG를 권장합니다.
|
|
293
293
|
- 이미지 비용은 `gpt-image-2` 공개 단가표 기반 **추정치**로 request log의 `image_cost_usd`에 별도 기록됩니다 (codex가 정확한 이미지 tool 사용량을 노출하지 않음).
|
|
294
|
+
- `imageGenerationOptions.background`는 `"auto" | "opaque" | "transparent"`를 지원합니다. `"transparent"` 요청만 기존 ChatGPT 구독 토큰으로 Codex 전용 `images/generations` 또는 `images/edits` 경로를 사용합니다. 나머지는 기존 Responses 도구 경로를 유지합니다. 투명 경로는 텍스트 모델 없이 `gpt-image-2`를 직접 실행하며, tools·structured output은 지원하지 않습니다. 레퍼런스는 최대 5장입니다. 불투명·완전 빈 이미지·손상된 PNG는 오류로 처리하고, 별도 배경 제거로 대체하지 않습니다.
|
|
295
|
+
- 실제 출력 정보는 `result.providerMetadata.qgrid.imageGeneration` 배열에 있습니다(`contentIndex`, `model`, `route`, `size`, `quality`, `background`, 이미지 `usage`). `result.content` 파일 파트에도 metadata가 있지만 `result.files[]`에는 없습니다. 실호출에서 `1024x1024`/`high` 요청이 `1254x1254`/`medium`으로 반환됐으므로, 요청값을 최종 출력값으로 간주하면 안 됩니다. qgrid는 실제 PNG 크기를 보고하며 리사이즈하지 않습니다.
|
|
296
|
+
- 투명 경로는 텍스트 모델을 실행하지 않아 일반 토큰 usage·비용이 0입니다. 이미지 usage는 별도로 보존하고, `image_cost_usd`는 보고된 토큰과 공개 API 단가로 추정합니다. 알려진 text/image input은 구분하고 불명확한 input은 보수적으로 계산하며, 캐시 할인은 반영하지 않습니다. 구독 청구액을 뜻하지 않습니다.
|
|
297
|
+
- 명시한 이미지 옵션은 이미지 도구 로그의 `requestedOptions`에 기록하며 `pricingAssumption`과 구분합니다. 옵션 생략 시 비용 추정에 쓰는 `1536x1024`/`medium`은 실제 출력 크기·품질의 기본값을 보장하지 않습니다.
|
|
298
|
+
|
|
299
|
+
투명 생성은 위 `imageGenerationOptions`에 `background: "transparent"`를 추가하고, 프롬프트에도 피사체 밖의 투명 배경을 명시하세요. 크로마키·배경색 지시는 제거해야 합니다. 이 기능이 포함된 서버와 SDK가 모두 필요하며, 저장 시 PNG 알파를 유지하세요. 정확한 최종 크기는 소비 앱의 명시적인 crop/resize 정책으로 처리합니다.
|
|
294
300
|
|
|
295
301
|
## Telemetry Logger
|
|
296
302
|
|
|
@@ -361,6 +367,7 @@ AI SDK response metadata로 실제 serving 모델을 다르게 보고하면 step
|
|
|
361
367
|
```typescript
|
|
362
368
|
type QgridSupportedModel =
|
|
363
369
|
// OpenAI (direct private Codex Responses backend)
|
|
370
|
+
| "openai/gpt-6-astra"
|
|
364
371
|
| "openai/gpt-5.6-sol"
|
|
365
372
|
| "openai/gpt-5.6-terra"
|
|
366
373
|
| "openai/gpt-5.6-luna"
|
|
@@ -390,15 +397,25 @@ type QgridSupportedModel =
|
|
|
390
397
|
|
|
391
398
|
`openai/gpt-5.4`, `openai/gpt-5.4-mini`, `openai/gpt-5.2`, `openai/gpt-5.3-codex`는 하위 호환을 위해 타입에 남아 있지만, qgrid가 사용하는 ChatGPT 구독 Codex 경로에서는 더 이상 제공되지 않습니다. `gpt-5.4`와 `gpt-5.4-mini`는 2026-08-31에 retire되었고(대체: `openai/gpt-5.6-terra`, `openai/gpt-5.6-luna`), `gpt-5.2`와 `gpt-5.3-codex`는 그보다 먼저 해당 경로에서 제거되었습니다. 이 id로 요청하면 백엔드에서 실패합니다.
|
|
392
399
|
|
|
400
|
+
### GPT-6 Astra 사양
|
|
401
|
+
|
|
402
|
+
| 모델 | Context (Codex 카탈로그) | 최대 출력 (공개 API) | 1M tokens당 input / cached input / output |
|
|
403
|
+
|---|---:|---:|---:|
|
|
404
|
+
| `openai/gpt-6-astra` | 272K | 128K | $10 / $1 / $50 |
|
|
405
|
+
|
|
406
|
+
2026-09-07에 조회한 Codex 카탈로그는 272K context window와 `low`, `medium`, `high`, `xhigh`, `max`, `ultra` reasoning effort를 제공합니다(백엔드 기본값: `medium`). Qgrid SDK의 기본값은 기존대로 `low`이며, 다른 깊이가 필요하면 effort를 명시하세요. [공개 API 모델 문서](https://developers.openai.com/api/docs/models/gpt-6-astra)는 별도로 1.05M context, 최대 입력 922K, 최대 출력 128K와 `max`까지의 effort를 명시하며 `ultra`는 포함하지 않습니다. 이 공개 API 한도를 구독 경로의 한도로 간주하지 않습니다. Qgrid 비용 추정에는 [표준 API 단가](https://developers.openai.com/api/docs/pricing)를 사용합니다. Cache write는 1M tokens당 $12.50이며, 입력이 272K tokens를 넘으면 요청 전체에 input/cache 2x, output 1.5x 단가가 적용됩니다.
|
|
407
|
+
|
|
393
408
|
### GPT-5.6 사양
|
|
394
409
|
|
|
395
|
-
| 모델 | Context (
|
|
410
|
+
| 모델 | Context (Codex 카탈로그) | 최대 출력 (공개 API) | 1M tokens당 input / cached input / cache write / output |
|
|
396
411
|
|---|---:|---:|---:|
|
|
397
|
-
| `openai/gpt-5.6-sol` |
|
|
398
|
-
| `openai/gpt-5.6-terra` |
|
|
399
|
-
| `openai/gpt-5.6-luna` |
|
|
412
|
+
| `openai/gpt-5.6-sol` | 272K | 128K | $4 / $0.40 / $5 / $20 |
|
|
413
|
+
| `openai/gpt-5.6-terra` | 272K | 128K | $2 / $0.20 / $2.50 / $12 |
|
|
414
|
+
| `openai/gpt-5.6-luna` | 272K | 128K | $0.20 / $0.02 / $0.25 / $1.20 |
|
|
415
|
+
|
|
416
|
+
2026-09-07에 조회한 Codex 카탈로그는 세 모델 모두 272K context window를 제공합니다. Sol과 Terra는 `ultra`까지, Luna는 `max`까지 reasoning effort를 지원합니다. 백엔드 기본값은 Sol이 `low`, Terra와 Luna가 `medium`이며, qgrid SDK의 기본값은 세 모델 모두 `low`입니다. [Sol](https://developers.openai.com/api/docs/models/gpt-5.6-sol), [Terra](https://developers.openai.com/api/docs/models/gpt-5.6-terra), [Luna](https://developers.openai.com/api/docs/models/gpt-5.6-luna)의 공개 API 문서는 별도로 1.05M context, 최대 입력 922K, 최대 출력 128K를 명시합니다. 이 공개 API 한도를 구독 경로의 한도로 간주하지 않습니다.
|
|
400
417
|
|
|
401
|
-
|
|
418
|
+
Qgrid 비용 추정에는 [표준 API 단가](https://developers.openai.com/api/docs/pricing)를 사용합니다. Sol의 표에 명시된 프로모션 가격은 최소 2026-11-21까지 제공되며, 이후 단가는 가정하지 않습니다. 입력이 272K tokens를 넘으면 요청 전체에 input/cache 2x, output 1.5x 단가가 적용됩니다. Cache write는 uncached input 단가의 1.25x입니다.
|
|
402
419
|
|
|
403
420
|
`anthropic/claude-fable-5`는 1M context와 128K 최대 출력을 지원합니다. 1M tokens당 표준 단가는 input $10, cache read $1, 5분 cache write $12.50, 1시간 cache write $20, output $50입니다. qgrid는 Claude 응답의 5분/1시간 cache creation breakdown을 보존해 TTL별 단가를 각각 적용하며, breakdown이 없는 구버전 응답에서만 Claude Code가 subscription OAuth 경로에 자동 적용하는 1시간 TTL 단가로 fallback합니다. Fable은 adaptive thinking이 항상 켜져 있어야 하므로 qgrid는 이 모델의 adaptive thinking을 보존합니다.
|
|
404
421
|
|
package/README.md
CHANGED
|
@@ -213,14 +213,14 @@ const { text } = await generateText({
|
|
|
213
213
|
| `tokenName` | provider-prefixed token name | both providers | Strictly targets one active token, such as `anthropic/yds`. The prefix must match the model provider; empty, missing, inactive, or over-threshold targets fail without fallback |
|
|
214
214
|
| `logger` | `boolean` | both providers | qgrid request logging. Defaults to `true`; `false` disables request-log persistence for this generation without disabling client tools or multi-step continuation |
|
|
215
215
|
| `sessionKey` | `string` | OpenAI only | Multi-turn conversation identifier used to derive opaque prompt-cache affinity while replaying full history (see [below](#multi-turn-prompt-cache-sessionkey)) |
|
|
216
|
-
| `effort` | OpenAI: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` \| `"ultra"` | OpenAI only (`QgridOpenAIProviderOptions`) | Reasoning depth on the ChatGPT-subscription Codex route. `"
|
|
216
|
+
| `effort` | OpenAI: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` \| `"ultra"` | OpenAI only (`QgridOpenAIProviderOptions`) | Reasoning depth on the ChatGPT-subscription Codex route. GPT-6 Astra and GPT-5.6 Sol/Terra support effort through `"ultra"`; GPT-5.6 Luna supports it through `"max"`; a value the model does not support is silently ignored by the server and the backend default applies. The public OpenAI API's `"none"`/`"minimal"` do not exist on this route |
|
|
217
217
|
| `effort` | Anthropic: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` | Anthropic only (`QgridAnthropicProviderOptions`) | Claude Code `--effort` levels. Values outside this set are silently ignored and qgrid's default (`"low"`) applies; per-model limits (for example no `"xhigh"` on Sonnet 4.6) are handled by Claude Code |
|
|
218
218
|
| `verbosity` | `"low"` \| `"medium"` \| `"high"` | OpenAI only | Response text verbosity |
|
|
219
219
|
| `reasoningSummary` | `"auto"` \| `"concise"` \| `"detailed"` \| `"none"` | OpenAI only | Reasoning summary output mode |
|
|
220
220
|
| `serviceTier` | `string` | OpenAI only | OpenAI/codex service tier |
|
|
221
221
|
| `timeoutMs` | positive integer, max `1_800_000` | Anthropic only | Server-side Claude Code process timeout in milliseconds. The SDK's non-stream HTTP budget is 60 seconds longer. Defaults to 240 seconds |
|
|
222
222
|
| `imageGeneration` | `boolean` | OpenAI only, non-stream | Enables codex's built-in `image_generation` tool (see [below](#image-generation)) |
|
|
223
|
-
| `imageGenerationOptions` | `{ quality?, size? }` | OpenAI only | Image
|
|
223
|
+
| `imageGenerationOptions` | `{ quality?, size?, background? }` | OpenAI only | Image controls; `background: "transparent"` selects standalone Images. Read actual size/quality from response metadata ([below](#image-generation)). |
|
|
224
224
|
| `fallbackModels` | `string[]` | reserved | Reserved for future qgrid server-side fallback routing. Not functional yet and unrelated to Claude Code's Fable refusal fallback |
|
|
225
225
|
|
|
226
226
|
```typescript
|
|
@@ -261,7 +261,7 @@ const { text } = await generateText({
|
|
|
261
261
|
|
|
262
262
|
### Image Generation
|
|
263
263
|
|
|
264
|
-
OpenAI/codex route only, `generateText` only. Enables
|
|
264
|
+
OpenAI/codex route only, `generateText` only. Enables image generation for that single request and returns the image through AI SDK `files`. Transparent backgrounds use standalone Codex Images; other requests use the hosted `image_generation` tool.
|
|
265
265
|
|
|
266
266
|
```typescript
|
|
267
267
|
const result = await generateText({
|
|
@@ -300,6 +300,36 @@ const result = await generateText({
|
|
|
300
300
|
- Image-generation requests do not retain provider conversation state. Their full input is sent directly.
|
|
301
301
|
- Reference images are sent as JSON data URLs. Compress or resize large photos before passing them in; oversized base64 inputs are rejected by the SDK. WebP/JPEG is recommended for photos.
|
|
302
302
|
- The image cost is an **estimate** based on the public `gpt-image-2` price table, recorded separately as `image_cost_usd` on the request log (codex does not expose exact image-tool usage).
|
|
303
|
+
- `imageGenerationOptions.background` accepts `"auto" | "opaque" | "transparent"`. Only `"transparent"` uses Codex's standalone `images/generations` or `images/edits` endpoint with the existing ChatGPT subscription token. Other image requests keep the hosted Responses tool. The transparent route runs `gpt-image-2` directly, without a text driver; it rejects tools and structured output. It accepts up to five reference images and preserves PNG bytes. Fully opaque, entirely empty, or invalid PNG results fail explicitly; there is no background-removal fallback.
|
|
304
|
+
- Transparent image output metadata is available in `result.providerMetadata.qgrid.imageGeneration` (an array containing `contentIndex`, `model`, `route`, `size`, `quality`, `background`, and optional image `usage`). Per-file metadata also appears on `result.content` file parts, not on `result.files[]`. Request options are hints: a live `1024x1024`/`high` request returned `1254x1254`/`medium`. qgrid reports the actual PNG dimensions and does not resize it.
|
|
305
|
+
- On the transparent route, regular token usage/cost is zero because no text driver ran. Image usage is preserved separately and `image_cost_usd` is an API-price estimate from reported usage, with known text/image input splits and conservative pricing for unknown input. It omits cache discounts and is not subscription billing.
|
|
306
|
+
- Explicit image options are recorded as `requestedOptions` in the synthetic image tool log, separately from `pricingAssumption`. When size/quality are omitted, the `1536x1024`/`medium` pricing defaults do not establish actual output dimensions or quality.
|
|
307
|
+
|
|
308
|
+
Transparent generation example (requires a server and SDK containing this feature):
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
import { generateText } from "ai";
|
|
312
|
+
import { qgrid, type QgridProviderOptions } from "@cartanova/qgrid-ai-sdk";
|
|
313
|
+
|
|
314
|
+
const result = await generateText({
|
|
315
|
+
model: qgrid("openai/gpt-5.5", { projectName: "deti" }),
|
|
316
|
+
prompt: "An isolated character. Everything outside the character must be transparent, with no backdrop or checkerboard.",
|
|
317
|
+
providerOptions: {
|
|
318
|
+
qgrid: {
|
|
319
|
+
imageGeneration: true,
|
|
320
|
+
imageGenerationOptions: {
|
|
321
|
+
background: "transparent",
|
|
322
|
+
quality: "high",
|
|
323
|
+
size: "1024x1536",
|
|
324
|
+
},
|
|
325
|
+
} satisfies QgridProviderOptions,
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
const png = result.files[0];
|
|
329
|
+
const observed = result.providerMetadata?.qgrid?.imageGeneration;
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Remove green-screen or other background instructions when requesting transparency. Preserve the returned PNG alpha when saving; exact final dimensions require an explicit downstream crop/resize policy.
|
|
303
333
|
|
|
304
334
|
## Telemetry Logger
|
|
305
335
|
|
|
@@ -371,6 +401,7 @@ The `qgrid()` provider has its own lifecycle, so the logger automatically suppre
|
|
|
371
401
|
```typescript
|
|
372
402
|
type QgridSupportedModel =
|
|
373
403
|
// OpenAI (direct private Codex Responses backend)
|
|
404
|
+
| "openai/gpt-6-astra"
|
|
374
405
|
| "openai/gpt-5.6-sol"
|
|
375
406
|
| "openai/gpt-5.6-terra"
|
|
376
407
|
| "openai/gpt-5.6-luna"
|
|
@@ -400,15 +431,25 @@ type QgridSupportedModel =
|
|
|
400
431
|
|
|
401
432
|
`openai/gpt-5.4`, `openai/gpt-5.4-mini`, `openai/gpt-5.2`, and `openai/gpt-5.3-codex` remain in the type for backward compatibility, but the ChatGPT-subscription Codex route that qgrid uses no longer serves them. `gpt-5.4` and `gpt-5.4-mini` retired on 2026-08-31 (replacements: `openai/gpt-5.6-terra` and `openai/gpt-5.6-luna`); `gpt-5.2` and `gpt-5.3-codex` were removed from that route earlier. Requests for these ids fail at the backend.
|
|
402
433
|
|
|
434
|
+
### GPT-6 Astra specifications
|
|
435
|
+
|
|
436
|
+
| Model | Context (Codex catalog) | Max output (public API) | Input / cached input / output per 1M tokens |
|
|
437
|
+
|---|---:|---:|---:|
|
|
438
|
+
| `openai/gpt-6-astra` | 272K | 128K | $10 / $1 / $50 |
|
|
439
|
+
|
|
440
|
+
The Codex catalog fetched on 2026-09-07 advertises a 272K context window and `low`, `medium`, `high`, `xhigh`, `max`, and `ultra` reasoning effort (backend default: `medium`). Qgrid's SDK still defaults to `low`; select an effort explicitly to override it. The [public API model page](https://developers.openai.com/api/docs/models/gpt-6-astra) separately lists a 1.05M context window, 922K maximum input, 128K maximum output, and reasoning effort through `max` (no `ultra`). Those public limits do not establish the subscription route's limits. [Standard API pricing](https://developers.openai.com/api/docs/pricing) is used for qgrid's cost estimate: cache writes cost $12.50 per 1M tokens, and input over 272K tokens applies 2x input/cache and 1.5x output rates to the full request.
|
|
441
|
+
|
|
403
442
|
### GPT-5.6 specifications
|
|
404
443
|
|
|
405
|
-
| Model | Context (
|
|
444
|
+
| Model | Context (Codex catalog) | Max output (public API) | Input / cached input / cache write / output per 1M tokens |
|
|
406
445
|
|---|---:|---:|---:|
|
|
407
|
-
| `openai/gpt-5.6-sol` |
|
|
408
|
-
| `openai/gpt-5.6-terra` |
|
|
409
|
-
| `openai/gpt-5.6-luna` |
|
|
446
|
+
| `openai/gpt-5.6-sol` | 272K | 128K | $4 / $0.40 / $5 / $20 |
|
|
447
|
+
| `openai/gpt-5.6-terra` | 272K | 128K | $2 / $0.20 / $2.50 / $12 |
|
|
448
|
+
| `openai/gpt-5.6-luna` | 272K | 128K | $0.20 / $0.02 / $0.25 / $1.20 |
|
|
449
|
+
|
|
450
|
+
The Codex catalog fetched on 2026-09-07 advertises a 272K context window for all three models. Sol and Terra support reasoning effort through `ultra`; Luna supports it through `max`. Backend defaults are `low` for Sol and `medium` for Terra and Luna, while qgrid's SDK defaults to `low` for all three. The public API model pages for [Sol](https://developers.openai.com/api/docs/models/gpt-5.6-sol), [Terra](https://developers.openai.com/api/docs/models/gpt-5.6-terra), and [Luna](https://developers.openai.com/api/docs/models/gpt-5.6-luna) separately list 1.05M context, 922K maximum input, and 128K maximum output; these do not establish the subscription route's limits.
|
|
410
451
|
|
|
411
|
-
|
|
452
|
+
Qgrid uses [Standard API pricing](https://developers.openai.com/api/docs/pricing) for cost estimates. Sol's listed promotional pricing is available at least through 2026-11-21; no later rate is assumed. Input over 272K tokens applies 2x input/cache and 1.5x output rates to the full request. Cache writes cost 1.25x the uncached input rate.
|
|
412
453
|
|
|
413
454
|
`anthropic/claude-fable-5` has a 1M context window and 128K max output. Its standard prices per 1M tokens are $10 input, $1 cache read, $12.50 five-minute cache write, $20 one-hour cache write, and $50 output. qgrid preserves Claude's 5m/1h cache-creation breakdown and prices each TTL separately; only legacy responses without that breakdown fall back to the one-hour TTL automatically selected by Claude Code on subscription OAuth. Fable requires always-on adaptive thinking, so qgrid preserves adaptive thinking for this model.
|
|
414
455
|
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { TelemetrySettings } from "ai";
|
|
|
4
4
|
/**
|
|
5
5
|
* OpenAI 경로(ChatGPT 구독 Codex 백엔드)의 reasoning effort. 백엔드 모델 카탈로그의
|
|
6
6
|
* supported_reasoning_levels 합집합이며, 공개 OpenAI API 의 `none`/`minimal` 은 이 경로에 없다.
|
|
7
|
-
*
|
|
7
|
+
* GPT-6 Astra와 GPT-5.6 Sol/Terra는 `ultra`, Luna는 `max`까지 지원한다.
|
|
8
|
+
* 모델이 지원하지 않는 값은 서버가 조용히 무시한다.
|
|
8
9
|
*/
|
|
9
10
|
type QgridOpenAIEffort = "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
10
11
|
/**
|
|
@@ -72,6 +73,8 @@ type QgridOpenAIProviderOptions = QgridCommonProviderOptions & {
|
|
|
72
73
|
imageGenerationOptions?: {
|
|
73
74
|
quality?: "low" | "medium" | "high";
|
|
74
75
|
size?: "1024x1024" | "1024x1536" | "1536x1024";
|
|
76
|
+
/** Transparent uses Codex standalone Images and validates PNG alpha. See README for limits. */
|
|
77
|
+
background?: "auto" | "opaque" | "transparent";
|
|
75
78
|
};
|
|
76
79
|
};
|
|
77
80
|
/** `providerOptions.qgrid` — Anthropic(Claude Code) 모델용. */
|
|
@@ -92,7 +95,29 @@ type QgridAnthropicProviderOptions = QgridCommonProviderOptions & {
|
|
|
92
95
|
* `QgridOpenAIProviderOptions` / `QgridAnthropicProviderOptions` 를 직접 쓰는 편이 정확하다.
|
|
93
96
|
*/
|
|
94
97
|
type QgridProviderOptions = QgridOpenAIProviderOptions | QgridAnthropicProviderOptions;
|
|
95
|
-
type QgridSupportedModel = "openai/gpt-5.6-sol" | "openai/gpt-5.6-terra" | "openai/gpt-5.6-luna" | "openai/gpt-5.5" | "openai/gpt-5.4" | "openai/gpt-5.2" | "openai/gpt-5.4-mini" | "openai/gpt-5.3-codex" | "openai/gpt-5.3-codex-spark" | "anthropic/claude-fable-5-1" | "anthropic/claude-fable-5" | "anthropic/claude-haiku-4-5" | "anthropic/claude-sonnet-4" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-sonnet-4-6" | "anthropic/claude-sonnet-4-7" | "anthropic/claude-sonnet-5" | "anthropic/claude-opus-4" | "anthropic/claude-opus-4-1" | "anthropic/claude-opus-4-5" | "anthropic/claude-opus-4-6" | "anthropic/claude-opus-4-7" | "anthropic/claude-opus-4-8" | "anthropic/claude-opus-5";
|
|
98
|
+
type QgridSupportedModel = "openai/gpt-6-astra" | "openai/gpt-5.6-sol" | "openai/gpt-5.6-terra" | "openai/gpt-5.6-luna" | "openai/gpt-5.5" | "openai/gpt-5.4" | "openai/gpt-5.2" | "openai/gpt-5.4-mini" | "openai/gpt-5.3-codex" | "openai/gpt-5.3-codex-spark" | "anthropic/claude-fable-5-1" | "anthropic/claude-fable-5" | "anthropic/claude-haiku-4-5" | "anthropic/claude-sonnet-4" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-sonnet-4-6" | "anthropic/claude-sonnet-4-7" | "anthropic/claude-sonnet-5" | "anthropic/claude-opus-4" | "anthropic/claude-opus-4-1" | "anthropic/claude-opus-4-5" | "anthropic/claude-opus-4-6" | "anthropic/claude-opus-4-7" | "anthropic/claude-opus-4-8" | "anthropic/claude-opus-5";
|
|
99
|
+
/** Observed image response values. Usage is response-level and appears on the first image only. */
|
|
100
|
+
type QgridImageGenerationMetadata = {
|
|
101
|
+
route: "codex-images";
|
|
102
|
+
model: "gpt-image-2";
|
|
103
|
+
background?: string;
|
|
104
|
+
quality?: string;
|
|
105
|
+
size?: string;
|
|
106
|
+
usage?: {
|
|
107
|
+
input_tokens: number;
|
|
108
|
+
output_tokens: number;
|
|
109
|
+
total_tokens: number;
|
|
110
|
+
input_tokens_details?: {
|
|
111
|
+
image_tokens: number;
|
|
112
|
+
text_tokens: number;
|
|
113
|
+
cached_tokens?: number;
|
|
114
|
+
};
|
|
115
|
+
output_tokens_details?: {
|
|
116
|
+
image_tokens: number;
|
|
117
|
+
text_tokens: number;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
96
121
|
type QgridLoggerConfig = {
|
|
97
122
|
/** qgrid 서버 주소. default: process.env.QGRID_URL, 없으면 기본값은 "http://localhost:44900" */
|
|
98
123
|
serverUrl?: string;
|
|
@@ -128,4 +153,4 @@ declare function createQgridLogger(config?: QgridLoggerConfig): TelemetrySetting
|
|
|
128
153
|
declare function qgrid(modelId: QgridOpenAIModel, config?: QgridOpenAIProviderConfig): LanguageModelV3;
|
|
129
154
|
declare function qgrid(modelId: QgridAnthropicModel, config?: QgridAnthropicProviderConfig): LanguageModelV3;
|
|
130
155
|
//#endregion
|
|
131
|
-
export { type QgridAnthropicEffort, type QgridAnthropicModel, type QgridAnthropicProviderConfig, type QgridAnthropicProviderOptions, type QgridLoggerConfig, type QgridOpenAIEffort, type QgridOpenAIModel, type QgridOpenAIProviderConfig, type QgridOpenAIProviderOptions, type QgridProviderConfig, type QgridProviderOptions, type QgridSupportedModel, createQgridLogger, qgrid as default, qgrid };
|
|
156
|
+
export { type QgridAnthropicEffort, type QgridAnthropicModel, type QgridAnthropicProviderConfig, type QgridAnthropicProviderOptions, type QgridImageGenerationMetadata, type QgridLoggerConfig, type QgridOpenAIEffort, type QgridOpenAIModel, type QgridOpenAIProviderConfig, type QgridOpenAIProviderOptions, type QgridProviderConfig, type QgridProviderOptions, type QgridSupportedModel, createQgridLogger, qgrid as default, qgrid };
|
package/dist/index.js
CHANGED
|
@@ -475,22 +475,36 @@ function extractPromptAndHistory(messages, options = {}) {
|
|
|
475
475
|
text: extracted.text
|
|
476
476
|
}]
|
|
477
477
|
});
|
|
478
|
-
} else if (msg.role === "assistant") {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
478
|
+
} else if (msg.role === "assistant") for (const part of msg.content) if ("text" in part && typeof part.text === "string") history.push({
|
|
479
|
+
type: "message",
|
|
480
|
+
role: "assistant",
|
|
481
|
+
content: [{
|
|
482
|
+
type: "output_text",
|
|
483
|
+
text: part.text
|
|
484
|
+
}]
|
|
485
|
+
});
|
|
486
|
+
else if ("toolName" in part && part.type === "tool-call") history.push({
|
|
487
|
+
type: "function_call",
|
|
488
|
+
name: part.toolName,
|
|
489
|
+
arguments: typeof part.input === "string" ? part.input : JSON.stringify(part.input),
|
|
490
|
+
call_id: part.toolCallId
|
|
491
|
+
});
|
|
492
|
+
else {
|
|
493
|
+
const url = extractImageUrl(part);
|
|
494
|
+
if (!url) continue;
|
|
495
|
+
if (includeImages) {
|
|
496
|
+
imageUrls.push(url);
|
|
497
|
+
history.push({
|
|
498
|
+
type: "message",
|
|
499
|
+
role: "assistant",
|
|
500
|
+
content: [{
|
|
501
|
+
type: "input_image",
|
|
502
|
+
image_url: url
|
|
503
|
+
}]
|
|
504
|
+
});
|
|
505
|
+
} else droppedImageCount++;
|
|
506
|
+
}
|
|
507
|
+
else if (msg.role === "tool") {
|
|
494
508
|
for (const part of msg.content) if ("toolName" in part && part.type === "tool-result") {
|
|
495
509
|
const output = part.output;
|
|
496
510
|
const text = "value" in output ? typeof output.value === "string" ? output.value : JSON.stringify(output.value) : JSON.stringify(output);
|
|
@@ -1062,6 +1076,10 @@ async function deriveCacheAffinityKey(modelId, sessionKey) {
|
|
|
1062
1076
|
return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
1063
1077
|
}
|
|
1064
1078
|
function qgridProviderMetadata(data) {
|
|
1079
|
+
const imageGeneration = data.content?.flatMap((item, contentIndex) => item.type === "image" && item.generation ? [{
|
|
1080
|
+
contentIndex,
|
|
1081
|
+
...item.generation
|
|
1082
|
+
}] : []);
|
|
1065
1083
|
return { qgrid: {
|
|
1066
1084
|
model: data.model,
|
|
1067
1085
|
requestedModel: data.requestedModel ?? data.model,
|
|
@@ -1071,7 +1089,8 @@ function qgridProviderMetadata(data) {
|
|
|
1071
1089
|
costUsd: data.costUsd,
|
|
1072
1090
|
costSource: data.costSource,
|
|
1073
1091
|
cacheCreation5mInputTokens: data.usage.cache_creation_5m_input_tokens ?? null,
|
|
1074
|
-
cacheCreation1hInputTokens: data.usage.cache_creation_1h_input_tokens ?? null
|
|
1092
|
+
cacheCreation1hInputTokens: data.usage.cache_creation_1h_input_tokens ?? null,
|
|
1093
|
+
...imageGeneration?.length ? { imageGeneration } : {}
|
|
1075
1094
|
} };
|
|
1076
1095
|
}
|
|
1077
1096
|
function getQgridProviderOptions(options) {
|
|
@@ -1219,7 +1238,8 @@ function qgrid(modelId, config) {
|
|
|
1219
1238
|
else if (item.type === "image") content.push({
|
|
1220
1239
|
type: "file",
|
|
1221
1240
|
mediaType: "image/png",
|
|
1222
|
-
data: item.data
|
|
1241
|
+
data: item.data,
|
|
1242
|
+
...item.generation ? { providerMetadata: { qgrid: { imageGeneration: item.generation } } } : {}
|
|
1223
1243
|
});
|
|
1224
1244
|
else if (item.type === "tool-call") content.push({
|
|
1225
1245
|
type: "tool-call",
|