Pika-aloitus
Hanki VibeQL API -avain, käännä ensimmäinen tekstisi ja ensimmäinen asiakirjasi muutamassa minuutissa.
Tällä sivulla etenet API-avaimesta käännettyyn tekstiin ja käännettyyn tiedostoon.
1. Hanki API-avain
- Kirjaudu sisään ja avaa API-sivu.
- Valitse Luo avain ja anna avaimelle nimi.
- Kopioi avain. Se alkaa
vql_. Hallintapaneeli näyttää koko avaimen vain kerran.
Tallenna avain ympäristömuuttujaan:
export VIBEQL_API_KEY="vql_..."
2. Käännä teksti
Lähetä yksi tai useampi text-arvo ja target_lang. Pyyntö käyttää DeepL-muotoa, joten viralliset DeepL-asiakaskirjastot toimivat, kun asetat palvelimen URL-osoitteeksi https://vibeql.com.
curl https://vibeql.com/v2/translate \
-H "Authorization: DeepL-Auth-Key $VIBEQL_API_KEY" \
-d "text=Hello, world" \
-d "target_lang=DE"# pip install deepl
import os
import deepl
client = deepl.DeepLClient(os.environ["VIBEQL_API_KEY"], server_url="https://vibeql.com")
result = client.translate_text("Hello, world", target_lang="DE")
print(result.text)// npm install deepl-node
import * as deepl from "deepl-node";
const client = new deepl.DeepLClient(process.env.VIBEQL_API_KEY, { serverUrl: "https://vibeql.com" });
const result = await client.translateText("Hello, world", null, "de");
console.log(result.text);// dotnet add package DeepL.net
using DeepL;
var client = new DeepLClient(
Environment.GetEnvironmentVariable("VIBEQL_API_KEY"),
new DeepLClientOptions { ServerUrl = "https://vibeql.com" });
var result = await client.TranslateTextAsync("Hello, world", null, "DE");
Console.WriteLine(result.Text);// Maven/Gradle: com.deepl.api:deepl-java
import com.deepl.api.*;
public class Example {
public static void main(String[] args) throws Exception {
DeepLClient client = new DeepLClient(System.getenv("VIBEQL_API_KEY"),
new DeepLClientOptions().setServerUrl("https://vibeql.com"));
TextResult result = client.translateText("Hello, world", null, "de");
System.out.println(result.getText());
}
}// composer require deeplcom/deepl-php
require_once 'vendor/autoload.php';
$client = new \DeepL\DeepLClient(getenv('VIBEQL_API_KEY'), ['server_url' => 'https://vibeql.com']);
$result = $client->translateText('Hello, world', null, 'de');
echo $result->text;package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
"strings"
)
func main() {
form := url.Values{}
form.Add("text", "Hello, world")
form.Set("target_lang", "DE")
req, _ := http.NewRequest("POST", "https://vibeql.com/v2/translate", strings.NewReader(form.Encode()))
req.Header.Set("Authorization", "DeepL-Auth-Key "+os.Getenv("VIBEQL_API_KEY"))
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var out struct {
Translations []struct {
Text string `json:"text"`
} `json:"translations"`
}
if err := json.NewDecoder(resp.Body).Decode(&out); err != nil {
panic(err)
}
fmt.Println(out.Translations[0].Text)
}# gem install deepl-rb
require 'deepl'
client = DeepL::Client.new(ENV.fetch('VIBEQL_API_KEY'), server_url: 'https://vibeql.com')
result = client.translate_text('Hello, world', nil, 'DE')
puts result.textVastaus:
{ "translations": [{ "detected_source_language": "EN", "text": "Hallo, Welt" }] }
3. Käännä asiakirja
Asiakirjan kääntäminen tapahtuu kolmessa vaiheessa: lataa tiedosto, tarkista tila, lataa tulos. Asiakaskirjastot tekevät kaikki kolme yhdellä kutsulla.
# Upload. The response has a document_id and a document_key.
curl https://vibeql.com/v2/document \
-H "Authorization: DeepL-Auth-Key $VIBEQL_API_KEY" \
-F "file=@report.docx" \
-F "target_lang=DE"
# Check the status until it is "done".
curl https://vibeql.com/v2/document/DOCUMENT_ID \
-H "Authorization: DeepL-Auth-Key $VIBEQL_API_KEY" \
-d "document_key=DOCUMENT_KEY"
# Download the translated file.
curl https://vibeql.com/v2/document/DOCUMENT_ID/result \
-H "Authorization: DeepL-Auth-Key $VIBEQL_API_KEY" \
-d "document_key=DOCUMENT_KEY" \
-o report.de.docxclient.translate_document_from_filepath("report.docx", "report.de.docx", target_lang="DE")await client.translateDocument("report.docx", "report.de.docx", null, "de");await client.TranslateDocumentAsync(
new FileInfo("report.docx"), new FileInfo("report.de.docx"), null, "DE");client.translateDocument(new File("report.docx"), new File("report.de.docx"), null, "de");$client->translateDocument('report.docx', 'report.de.docx', null, 'de');client.translate_document('report.docx', 'report.de.docx', nil, 'DE')VibeQL hyväksyy DOCX-, PPTX-, PDF- ja TXT-tiedostot. Käännetyt tiedostot ovat saatavilla 24 tuntia. Katso koko työnkulku kohdasta Käännä asiakirjoja.
Seuraavat vaiheet
- Todennus: kaikki tavat lähettää avaimesi.
- Käännä teksti ja Käännä asiakirjoja: parametrit ja vastaukset.
- Siirry DeepListä, Googlesta tai Azzuresta.
- MCP-asetukset: käännä tiedostoja Claudessa, Cursorissa tai VS Codessa.