curl --request POST \
--url https://api.bibigpt.co/api/v1/generateImage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"imageUrl": "<string>",
"prompt": "<string>",
"model": "nanobanana-2-lite"
}
'import requests
url = "https://api.bibigpt.co/api/v1/generateImage"
payload = {
"imageUrl": "<string>",
"prompt": "<string>",
"model": "nanobanana-2-lite"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({imageUrl: '<string>', prompt: '<string>', model: 'nanobanana-2-lite'})
};
fetch('https://api.bibigpt.co/api/v1/generateImage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bibigpt.co/api/v1/generateImage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'imageUrl' => '<string>',
'prompt' => '<string>',
'model' => 'nanobanana-2-lite'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bibigpt.co/api/v1/generateImage"
payload := strings.NewReader("{\n \"imageUrl\": \"<string>\",\n \"prompt\": \"<string>\",\n \"model\": \"nanobanana-2-lite\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bibigpt.co/api/v1/generateImage")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"imageUrl\": \"<string>\",\n \"prompt\": \"<string>\",\n \"model\": \"nanobanana-2-lite\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bibigpt.co/api/v1/generateImage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"imageUrl\": \"<string>\",\n \"prompt\": \"<string>\",\n \"model\": \"nanobanana-2-lite\"\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>",
"status": "pending",
"imageUrl": "<string>",
"timestamp": 123,
"costCredits": 123,
"balanceRemaining": 123
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Generate or edit an image with AI (chatimg.ai)
curl --request POST \
--url https://api.bibigpt.co/api/v1/generateImage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"imageUrl": "<string>",
"prompt": "<string>",
"model": "nanobanana-2-lite"
}
'import requests
url = "https://api.bibigpt.co/api/v1/generateImage"
payload = {
"imageUrl": "<string>",
"prompt": "<string>",
"model": "nanobanana-2-lite"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({imageUrl: '<string>', prompt: '<string>', model: 'nanobanana-2-lite'})
};
fetch('https://api.bibigpt.co/api/v1/generateImage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bibigpt.co/api/v1/generateImage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'imageUrl' => '<string>',
'prompt' => '<string>',
'model' => 'nanobanana-2-lite'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bibigpt.co/api/v1/generateImage"
payload := strings.NewReader("{\n \"imageUrl\": \"<string>\",\n \"prompt\": \"<string>\",\n \"model\": \"nanobanana-2-lite\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bibigpt.co/api/v1/generateImage")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"imageUrl\": \"<string>\",\n \"prompt\": \"<string>\",\n \"model\": \"nanobanana-2-lite\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bibigpt.co/api/v1/generateImage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"imageUrl\": \"<string>\",\n \"prompt\": \"<string>\",\n \"model\": \"nanobanana-2-lite\"\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>",
"status": "pending",
"imageUrl": "<string>",
"timestamp": 123,
"costCredits": 123,
"balanceRemaining": 123
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
URL of the source image to process. Supports http URLs and base64 encoded images (with or without data:image/... prefix)
1Prompt describing the desired transformation (default: ghibli style)
AI model to use (default: nanobanana-2-lite). Pricing per image: openai: 25 credits, gpt-image-2: 50 credits, gpt-image-2.5-flare: 50 credits, gpt-image-2.5-sunburst: 50 credits, mai-image-2.6-flash: 20 credits, flux: 12 credits, gemini: 10 credits, nanobanana-pro: 30 credits, nanobanana-2-lite: 12 credits, nanobanana-2: 20 credits, grok: 30 credits, seedream: 15 credits, qwen: 8 credits, z-image-turbo: 5 credits, flux-2-flex: 25 credits
openai, gpt-image-2, gpt-image-2.5-flare, gpt-image-2.5-sunburst, mai-image-2.6-flash, flux, gemini, nanobanana-pro, nanobanana-2-lite, nanobanana-2, grok, seedream, qwen, z-image-turbo, flux-2-flex 响应
Successful response
Unique identifier for the generation task
Initial status of the generation task (pending)
pending, completed, error, unknown The source image URL, used as the key when polling /v1/imageStatus
Timestamp when the task was created
Credits charged for this generation
Remaining credits balance after this charge
此页面对您有帮助吗?
