Use Cases + Implementation

How do you build translation with an OpenAI-compatible API?

Translation on an OpenAI-compatible API is a chat completions call with a translation prompt: send source segments, require structured output, and validate before storing. Use JSON mode so each segment comes back with its id and target text, inject glossary terms in the system prompt, and verify placeholders deterministically. Existing OpenAI SDK code moves over by changing the base URL and model names.

Key facts

EndpointPOST https://api.plugsky.com/v1/chat/completions — same shape as OpenAI (live)
CompatibilityKeep your SDK; change base_url and model names
JSON modeLive for per-segment structured translation output
Models30+ models; route by language pair and content type
LanguagesMultilingual models cover right-to-left and mixed-language content
PricingFlat monthly self-serve plans with no per-token charges on self-serve
Free tierplugsky-micro and plugsky-lite on the free plan, no card required
RoadmapThe batch endpoint is coming soon; run concurrent segment workers today

TL;DR

  • Translation is one chat completions call plus a strict output contract.
  • Return one object per segment so ids and order survive parsing.
  • Pin glossary terms in the system prompt; verify them after generation.
  • Check placeholders, tags and numbers with deterministic code.
  • Route by language pair instead of using one model everywhere.

How it works, step by step

  1. Segment the source with stable ids and keep the surrounding context for each unit.
  2. Point your OpenAI-compatible client at Plugsky and send a two-segment translation request to confirm structured output.
  3. Define a JSON contract such as a list of {id, target, notes} objects and request it with JSON mode.
  4. Inject approved glossary terms for the segment's domain and instruct the model not to translate protected strings.
  5. Validate the response against the schema and run placeholder and numeric checks before storage.
  6. Batch segments in bounded-parallel workers with retries, and route flagged output to reviewers.
  7. Record which model and prompt version produced each segment for audit and rollback.
1Segment the sourcewith stable ids andkeep the2Point yourOpenAI-compatibleclient at Plugsky3Define a JSONcontract such as alist of {id,4Inject approvedglossary terms forthe segment's5Validate theresponse againstthe schema and run6Batch segments inbounded-parallelworkers with

Try it yourself

Open the OpenAI-compatible API tester →

One endpoint, a strict segment contract

Translation integrations fail on parsing, not on language. Ask for structured output — a list of objects with the segment id and target text — and validate it before anything is stored. JSON mode makes that contract reliable, and because the request shape matches OpenAI, your existing client, retry policy and tests survive the move to Plugsky with a base URL and model-name change.

Send segments in batches that fit comfortably in context, keep ids in the output, and reject responses with missing or duplicated ids. Treat the model as a translator, not an orchestrator: your code owns segmentation, glossary selection and publication order.

Glossary terms, protected strings and locale rules

Terminology belongs in the prompt as explicit instruction, and in your code as a check. For each segment, assemble the approved terms that appear in it and state them plainly: use this target, do not translate this brand name, keep this variable. After generation, verify each instruction with deterministic code so a violated glossary rule cannot ship silently.

  • Keep do-not-translate lists for brands, product names and code identifiers.
  • Specify formality and locale conventions per target market in the system prompt.
  • Preserve placeholders exactly; a translated variable name breaks the product.
  • Reject output that returns untranslated source text unless it is on a protected list.

Routing, batching and review

One model does not fit every language pair equally well. Route high-volume UI strings to cheap multilingual tiers, send marketing and legal copy to stronger models, and evaluate per direction because quality is not symmetric across a language pair. Keep the model name in configuration so re-routing is a deploy-free change.

The batch endpoint is coming soon, so today you fan out with bounded concurrency, exponential backoff and a queue that survives worker restarts. Have reviewers see source, draft and glossary checks side by side, and feed approved pairs back into translation memory. Build the pipeline on the free plan with plugsky-micro and plugsky-lite, then evaluate stronger models during the 14-day full-access trial; the live pricing page lists current plans.

Honest comparison

ConcernTranslation on PlugskyCloud translation serviceSelf-hosted MT
IntegrationOpenAI SDK, base URL changeVendor SDK and APIServe an engine yourself
Output shapeJSON per segmentVendor formatCustom wrapper
TerminologyPrompt plus deterministic checksGlossary features per tierRetrain or rule engine
Model choice30+ models behind one endpointVendor enginesModels you can host
DeploymentCloud, VPC, on-prem, air-gappedVendor cloudYour infrastructure

Frequently asked questions

Can my existing OpenAI translation code move to Plugsky?

Yes. The endpoint is OpenAI-compatible: change the base URL and model names, keep your prompts and validation. Moving back later is the same one-line change in reverse.

How should I structure the output?

Request a JSON list of objects with the segment id and target text, validate the schema, and reject responses with missing or duplicated ids before storage.

How do I enforce a glossary?

Put the approved terms for each segment in the prompt and verify them with deterministic checks after generation. Violations go to review instead of production.

Which models are best for translation?

It depends on the language pair and content type. Route high-volume UI strings to cheap multilingual tiers, use stronger models for brand and legal copy, and evaluate per pair. All 30+ models sit behind one endpoint.

Does streaming make sense for translation?

Rarely. Translation is consumed as complete segments, so request structured non-streaming output and stream only if a human is watching the text appear.

Is batch translation available?

The batch endpoint is coming soon. Today, use bounded concurrency in your own workers with retries, a durable queue and per-segment status tracking.

How do I evaluate translation quality?

Review per language pair and content type: terminology adherence, placeholder integrity, edit distance after human review and time-to-publish. Track these on every model or prompt change.

Can I test without paying?

Yes. The free plan includes plugsky-micro and plugsky-lite with no card, and a 14-day full-access trial unlocks stronger models for a pilot.