1curl https://api.arliai.com/v1/chat/completions \
2-H "Content-Type: application/json" \
3-H "Authorization: Bearer YOUR_ARLIAI_API_KEY" \
4-d '{
5"model": "TEXT_GENERATION_MODEL",
6"messages": [
7 {"role": "system", "content": "You are a helpful assistant."},
8 {"role": "user", "content": "Hello!"},
9 {"role": "assistant", "content": "Hi!, how can I help you today?"},
10 {"role": "user", "content": "Say hello!"}
11],
12"repetition_penalty": 1.1,
13"temperature": 0.7,
14"top_p": 0.9,
15"top_k": 40,
16"max_completion_tokens": 1024,
17"stream": false
18}'이 예제를 API 키로 테스트하려면 로그인하세요.
참고: 일부 모델은 시스템 프롬프트를 허용하지 않을 수 있습니다. YOUR_ARLIAI_API_KEY를 실제 키로 바꾸세요.
1curl https://api.arliai.com/v1/completions \
2-H "Content-Type: application/json" \
3-H "Authorization: Bearer YOUR_ARLIAI_API_KEY" \
4-d '{
5"model": "TEXT_GENERATION_MODEL",
6"prompt": "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nYou are an assistant AI.<|eot_id|><|start_header_id|>user<|end_header_id|>\n\nHello there!<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n",
7"repetition_penalty": 1.1,
8"temperature": 0.7,
9"top_p": 0.9,
10"top_k": 40,
11"max_completion_tokens": 1024,
12"stream": false
13}'이 예제를 API 키로 테스트하려면 로그인하세요.
참고: 완성을 사용할 때 각 모델에 대해 권장 프롬프트 형식을 사용하세요. 표시된 예제는 Llama 3 Instruct 형식입니다. YOUR_ARLIAI_API_KEY를 실제 키로 바꾸세요.
1curl https://api.arliai.com/v1/embeddings \
2-H "Content-Type: application/json" \
3-H "Authorization: Bearer YOUR_ARLIAI_API_KEY" \
4-d '{
5 "model": "EMBEDDING_MODEL_NAME",
6 "input": [
7 "The food was delicious.",
8 "The service was slow."
9 ],
10 "encoding_format": "float"
11}'이 예제를 API 키로 테스트하려면 로그인하세요.
참고: input 또는 messages 중 정확히 하나를 보내세요. 요청당 최대 20개의 입력 또는 대화가 허용됩니다. 멀티모달 임베딩의 경우 base64 이미지 데이터 URI와 함께 messages를 사용하세요. 응답에는 usage.prompt_tokens가 포함됩니다. GET /v1/embedding-models로 사용 가능한 모델을 나열하세요. 자리 표시자를 실제 값으로 바꾸세요.
1curl https://api.arliai.com/sdapi/v1/txt2img \
2-H "Content-Type: application/json" \
3-H "Authorization: Bearer YOUR_ARLIAI_API_KEY" \
4-d '{
5 "prompt": "A photo of an astronaut riding a horse on the moon",
6 "negative_prompt": "ugly, blurry, low quality",
7 "steps": 30,
8 "sampler_name": "Default",
9 "width": 1024,
10 "height": 1024,
11 "sd_model_checkpoint": "IMAGE_GENERATION_MODEL",
12 "seed": -1,
13 "cfg_scale": 7
14}'이 예제를 API 키로 테스트하려면 로그인하세요.
참고: 요청 본문에 JSON으로 매개변수를 보내세요. sd_model_checkpoint 및 prompt 필드는 필수입니다. 생성된 이미지는 base64 인코딩 문자열로 images 배열에 반환됩니다. 최대 steps는 40입니다. YOUR_ARLIAI_API_KEY와 모델 이름을 필요에 따라 바꾸세요.
1# First, get your base64 encoded image string, e.g., using:
2# base64 input_image.png | tr -d '\n' > image.b64
3# Then copy the content of image.b64 into the init_images array below
4
5curl https://api.arliai.com/sdapi/v1/img2img \
6-H "Content-Type: application/json" \
7-H "Authorization: Bearer YOUR_ARLIAI_API_KEY" \
8-d '{
9 "init_images": ["YOUR_BASE64_ENCODED_IMAGE_STRING_HERE"],
10 "prompt": "Make the horse blue",
11 "negative_prompt": "ugly, blurry, low quality, text, watermark",
12 "steps": 30,
13 "sampler_name": "Default",
14 "width": 1024,
15 "height": 1024,
16 "sd_model_checkpoint": "IMAGE_GENERATION_MODEL",
17 "seed": -1,
18 "cfg_scale": 7,
19 "denoising_strength": 0.75
20}'참고: sd_model_checkpoint, prompt, init_images 필드는 필수입니다. init_images는 초기 이미지의 base64 인코딩 문자열을 하나 이상 포함하는 배열이어야 합니다. 최대 steps는 40입니다. 자리 표시자를 실제 데이터로 바꾸세요.
1# First, get your base64 encoded image string, e.g., using:
2# base64 input_image.png | tr -d '\n' > image.b64
3# Then copy the content of image.b64 into the image field below
4
5curl https://api.arliai.com/sdapi/v1/extra-single-image \
6-H "Content-Type: application/json" \
7-H "Authorization: Bearer YOUR_ARLIAI_API_KEY" \
8-d '{
9 "image": "YOUR_BASE64_ENCODED_IMAGE_STRING_HERE",
10 "upscaler_1": "R-ESRGAN 4x+",
11 "upscaling_resize": 2
12}'참고: image 필드는 필수이며 업스케일하려는 이미지의 base64 인코딩 문자열을 포함해야 합니다. 업스케일된 이미지는 base64 인코딩 문자열로 image 필드(배열 아님)에 반환됩니다. 자리 표시자를 실제 데이터로 바꾸세요.