본문으로 건너뛰기

빠른 시작

VibeQL API 키를 발급받고 몇 분 만에 첫 텍스트와 첫 문서를 번역해 보세요.

Markdown

이 페이지에서는 API 키를 발급받는 것부터 텍스트와 파일을 번역하는 것까지 안내해요.

1. API 키 발급받기

  1. 로그인한 뒤 API 페이지를 여세요.
  2. 키 생성을 선택하고 키에 이름을 붙이세요.
  3. 키를 복사하세요. 키는 vql_로 시작해요. 대시보드에서 전체 키는 한 번만 보여요.

키를 환경 변수에 저장하세요:

export VIBEQL_API_KEY="vql_..."

2. 텍스트 번역하기

하나 이상의 text 값과 target_lang를 보내세요. 요청은 DeepL 형식을 사용하므로 서버 URL을 https://vibeql.com로 설정하면 공식 DeepL 클라이언트 라이브러리를 그대로 쓸 수 있어요.

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.text

응답:

{ "translations": [{ "detected_source_language": "EN", "text": "Hallo, Welt" }] }

3. 문서 번역하기

문서 번역은 파일 업로드, 상태 확인, 결과 다운로드의 세 단계로 진행돼요. 클라이언트 라이브러리를 쓰면 이 세 단계를 한 번의 호출로 처리할 수 있어요.

# 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.docx
client.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은 DOCX, PPTX, PDF, TXT 파일을 지원해요. 번역된 파일은 24시간 동안 내려받을 수 있어요. 전체 흐름은 문서 번역을 참고하세요.

다음 단계