Skip to content

API v2: Supertext's platform API in all six SDKs - #22

Open
superblaettler wants to merge 7 commits into
mainfrom
api-v2
Open

superblaettler wants to merge 7 commits into
mainfrom
api-v2

Conversation

@superblaettler

Copy link
Copy Markdown
Collaborator

Adds Supertext's new platform API (https://api-platform.supertext.com/v1/, Authorization: Bearer st_live_…) as a v2 namespace next to v1 in TypeScript, PHP, Python, .NET, Java and Kotlin. v1 is unchanged.

  • translateTexts with the same keyed segments as v1, now as direct translate/ai/text requests (≤ 10,000 characters; HTML segments with tag_handling: html; a longer segment through the file endpoint; blanks unchanged)
  • translateText/quoteText, AI file translation of any supported format (translateFile, single steps, quotes, glossary, OCR), language detection, human review (fused text and file, quotes, idempotency key), getAccount, getFeatures, validateApiKey, checkApiKey (v1 ApiKeyCheck on GET account), webhooks CRUD and the Standard Webhooks signature check
  • One error type with the v2 codes from Supertext's problem+json answers (insufficient_credit, invalid_request, …) and detail, apiErrorCode, errorId, reason
  • spec/v2/ vectors (plus Supertext's openapi.json), stand-in/stand-in-v2.mjs, conformance.mjs --v2, and a v2 conformance step for every SDK in CI
  • Java/Kotlin transports keep bodies as bytes so binary documents download intact (old constructors still work)
  • Integration guide (new section 16), API reference, all SDK READMEs, DEVELOPER.md, README, CLAUDE.md, CHANGELOG

Not tested against the live v2 API beyond the 401 answer shape: that needs a v2 workspace key as a CI secret.


Generated by Claude Code

A v2 namespace next to v1 (TypeScript supertext-sdk/v2, PHP Supertext\Sdk\V2,
Python supertext.v2, .NET Supertext.Sdk.V2, Java and Kotlin
com.supertext.sdk.v2) for https://api-platform.supertext.com/v1/ with Bearer
workspace keys: translateTexts as direct text requests (10,000 characters,
HTML with tag_handling, file fallback for long segments), text and file
translation, quotes, language detection, human review, account, features,
the key check on GET account, webhooks and the webhook signature check.

spec/v2/ vectors (auth header, errors, batching, webhooks, key check,
conformance, Supertext's openapi.json), stand-in/stand-in-v2.mjs,
conformance.mjs --v2 and CI runs for every SDK. Java and Kotlin transports
keep response bodies as bytes for binary downloads. Docs and changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyQoDKLydLVddfSfLyxQF4
Comment thread sdk/typescript/src/v2/auth.ts Fixed
Comment thread sdk/typescript/src/v2/errors.ts Fixed
Comment thread sdk/typescript/src/v2/errors.ts Fixed
Comment thread sdk/typescript/src/v2/errors.ts Fixed
…rint through v1's (CodeQL)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyQoDKLydLVddfSfLyxQF4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyQoDKLydLVddfSfLyxQF4
Comment thread scripts/live-v2.mjs
async function check(name, run) {
try {
const note = await run()
console.log(`ok ${name}${note ? `: ${note}` : ''}`)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyQoDKLydLVddfSfLyxQF4
…n as the text endpoint)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyQoDKLydLVddfSfLyxQF4
… Live API v2 workflow)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyQoDKLydLVddfSfLyxQF4

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants