Hoppa till innehållet

Byt från DeepL

Flytta en DeepL API-integration till VibeQL genom att ändra server-URL:en och nyckeln i ditt DeepL-klientbibliotek.

Markdown

VibeQL hanterar DeepL API-formatet. Behåll din kod och ditt DeepL-klientbibliotek. Ändra två saker:

  1. Server-URL:en: https://vibeql.com.
  2. Nyckeln: en VibeQL-nyckel från API-sidan.

Ändra server-URL:en

client = deepl.DeepLClient(os.environ["VIBEQL_API_KEY"], server_url="https://vibeql.com")
const client = new deepl.DeepLClient(process.env.VIBEQL_API_KEY, { serverUrl: "https://vibeql.com" });
var client = new DeepLClient(apiKey, new DeepLClientOptions { ServerUrl = "https://vibeql.com" });
DeepLClient client = new DeepLClient(apiKey, new DeepLClientOptions().setServerUrl("https://vibeql.com"));
$client = new \DeepL\DeepLClient($apiKey, ['server_url' => 'https://vibeql.com']);
// DeepL has no official Go library. Change the base URL in your HTTP code.
const baseURL = "https://vibeql.com" // was https://api.deepl.com or https://api-free.deepl.com
req, _ := http.NewRequest("POST", baseURL+"/v2/translate", body)
req.Header.Set("Authorization", "DeepL-Auth-Key "+os.Getenv("VIBEQL_API_KEY"))
client = DeepL::Client.new(ENV.fetch('VIBEQL_API_KEY'), server_url: 'https://vibeql.com')

Den äldre klassen Translator tar samma alternativ. Med det äldre Ruby-API:et på modulnivå anger du config.host = 'https://vibeql.com' i DeepL.configure.

Om du anropar API:et över vanlig HTTP ersätter du https://api.deepl.com eller https://api-free.deepl.com med https://vibeql.com. Sökvägar och parametrar är desamma.

Det som blir kvar

  • Endpoints: POST /v2/translate, POST /v2/document, POST /v2/document/{id}, POST /v2/document/{id}/result, GET|POST /v2/usage, GET|POST /v2/languages och GET /v3/languages.
  • Headern Authorization: DeepL-Auth-Key och det äldre fältet auth_key.
  • JSON-fältnamn, till exempel translations, detected_source_language, document_id, document_key, seconds_remaining och billed_characters.
  • Dokumentstatusar: queued, translating, done, error.
  • Statuskoder: 400, 403, 404, 413, 456, 503.
  • Språkkoder, bland annat EN-US, PT-BR, ES-419 och ZH-HANT. Se Språk.

Det som skiljer sig

DeepL VibeQL
Minimum per dokument 50 000 tecken Nej. Ett dokument använder de tecken det har.
Ordlistor Ja Nej. glossary_id ignoreras och det finns inga ordliste-endpoints.
Formalitet Ja, för vissa språk Nej. formality ignoreras och supports_formality är false.
detected_source_language på /v2/translate Identifierat språk Ditt source_lang, eller EN om du utelämnar det
Andra DeepL-API:er, till exempel DeepL Write Ja Inte tillgängligt
Dokumentformat Många DOCX, PPTX, PDF, TXT
Pris Se DeepL Se Priser

Översättningarna kommer från AI-översättningsmodeller, så formuleringarna kan skilja sig från DeepL:s resultat för samma text. Testa ett urval av ditt eget innehåll innan du flyttar all trafik.

Kontrollera bytet

curl https://vibeql.com/v2/usage \
  -H "Authorization: DeepL-Auth-Key $VIBEQL_API_KEY"

Ett svar med 200 och character_count samt character_limit bekräftar att URL:en och nyckeln fungerar.