2:I[8087,["972","static/chunks/972-6d5b5069acc8181c.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98","199","static/chunks/199-28b0afba722f0826.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98","282","static/chunks/app/zh/guide/%5Bslug%5D/page-d32d8663762a396a.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98"],"CopyableText"]
3:I[2972,["972","static/chunks/972-6d5b5069acc8181c.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98","199","static/chunks/199-28b0afba722f0826.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98","282","static/chunks/app/zh/guide/%5Bslug%5D/page-d32d8663762a396a.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98"],""]
4:I[4707,[],""]
6:I[6423,[],""]
7:I[8988,["972","static/chunks/972-6d5b5069acc8181c.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98","185","static/chunks/app/layout-662657d543144088.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98"],"SiteHeader"]
8:I[5706,["972","static/chunks/972-6d5b5069acc8181c.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98","185","static/chunks/app/layout-662657d543144088.js?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98"],"SiteFooter"]
5:["slug","gpt-image-2-api","d"]
0:["cIMu9n2gFhwavR3-Mxqd2",[[["",{"children":["zh",{"children":["guide",{"children":[["slug","gpt-image-2-api","d"],{"children":["__PAGE__?{\"slug\":\"gpt-image-2-api\"}",{}]}]}]}]},"$undefined","$undefined",true],["",{"children":["zh",{"children":["guide",{"children":[["slug","gpt-image-2-api","d"],{"children":["__PAGE__",{},[["$L1",[["$","script",null,{"type":"application/ld+json","dangerouslySetInnerHTML":{"__html":"{\"@context\":\"https://schema.org\",\"@type\":\"BreadcrumbList\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"é¦–é¡µ\",\"item\":\"https://crazyrouter.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"æŒ‡å—\",\"item\":\"https://crazyrouter.com/zh/guide\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"GPT Image 2 API ä¸­æ–‡æŽ¥å…¥æŒ‡å—\",\"item\":\"https://crazyrouter.com/zh/guide/gpt-image-2-api\"}]}"}}],["$","script",null,{"type":"application/ld+json","dangerouslySetInnerHTML":{"__html":"{\"@context\":\"https://schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"è¿™äº›ä»·æ ¼æ¥è‡ªå“ªé‡Œï¼Ÿ\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"ä»·æ ¼å¡ç‰‡æ¥è‡ª Crazyrouter ä»·æ ¼é¡µå¯¹åº”çš„ GET https://cn.crazyrouter.com/api/pricing å¿«ç…§ï¼Œç”¨æ¥å±•ç¤ºå½“å‰å…¬å¼€æ¨¡åž‹åã€ç«¯ç‚¹ç±»åž‹å’Œè®¡è´¹æ–¹å¼ã€‚\"}},{\"@type\":\"Question\",\"name\":\"OpenAI SDK åº”è¯¥é…ç½®å“ªä¸ª Base URLï¼Ÿ\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"OpenAI å…¼å®¹ SDK ä½¿ç”¨ https://cn.crazyrouter.com/v1ï¼›æ‰‹å†™ cURL ä½¿ç”¨å®Œæ•´è·¯å¾„ï¼Œä¾‹å¦‚ https://cn.crazyrouter.com/v1/images/generationsã€‚\"}},{\"@type\":\"Question\",\"name\":\"gpt-image-2 å¯ä»¥ç›´æŽ¥ä½¿ç”¨ size å’Œ quality å—ï¼Ÿ\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"å¯ä»¥ã€‚å½“å‰ GPT Image æ–‡æ¡£æ”¯æŒ size å’Œ qualityã€‚size å¯ä»¥æ˜¯ auto æˆ–ç¬¦åˆé™åˆ¶çš„å®½xé«˜ï¼›quality å¯ä»¥æ˜¯ autoã€lowã€mediumã€highï¼Œæ—§å®¢æˆ·ç«¯ä¼  standard æ—¶ä¼šè¢«å½’ä¸€ä¸º autoã€‚\"}}]}"}}],["$","script",null,{"type":"application/ld+json","dangerouslySetInnerHTML":{"__html":"{\"@context\":\"https://schema.org\",\"@type\":\"SoftwareApplication\",\"name\":\"GPT Image 2 API ä¸­æ–‡æŽ¥å…¥æŒ‡å—\",\"applicationCategory\":\"DeveloperApplication\",\"operatingSystem\":\"Web\",\"offers\":{\"@type\":\"Offer\",\"priceCurrency\":\"USD\",\"availability\":\"https://schema.org/OnlineOnly\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Crazyrouter\",\"url\":\"https://crazyrouter.com\"}}"}}],["$","main",null,{"children":[["$","section",null,{"className":"border-b border-line bg-panel","children":["$","div",null,{"className":"mx-auto max-w-6xl px-5 py-14 md:py-18","children":[["$","div",null,{"className":"text-sm font-semibold uppercase tracking-wide text-brand","children":"å›¾ç‰‡ API æŒ‡å—"}],["$","h1",null,{"className":"mt-4 max-w-4xl text-4xl font-semibold leading-tight text-ink md:text-6xl","children":"GPT Image 2 API ä¸­æ–‡æŽ¥å…¥æŒ‡å—"}],["$","p",null,{"className":"mt-5 max-w-3xl text-lg leading-8 text-muted","children":"ä½¿ç”¨ Crazyrouter è°ƒç”¨ gpt-image-2 ç”Ÿæˆå’Œç¼–è¾‘å›¾ç‰‡ã€‚OpenAI å…¼å®¹å®¢æˆ·ç«¯æŠŠ base_url é…ç½®ä¸º https://cn.crazyrouter.com/v1ï¼Œå›¾ç‰‡ç”Ÿæˆè¯·æ±‚å‘é€åˆ° /v1/images/generationsã€‚"}],["$","div",null,{"className":"mt-8 flex flex-wrap items-center gap-4","children":[["$","a",null,{"href":"https://crazyrouter.com","className":"inline-flex items-center gap-2 rounded-md bg-ink px-5 py-3 text-sm font-semibold text-white","children":["åˆ›å»º API Key",["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":16,"height":16,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-arrow-right","aria-hidden":"true","children":[["$","path","1ays0h",{"d":"M5 12h14"}],["$","path","xquz4c",{"d":"m12 5 7 7-7 7"}],"$undefined"]}]]}],["$","a",null,{"href":"https://docs.crazyrouter.com/llms.txt","className":"inline-flex items-center gap-2 rounded-md border border-line bg-white px-5 py-3 text-sm font-semibold text-ink","children":["æŸ¥çœ‹æ–‡æ¡£ç´¢å¼•",["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":16,"height":16,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-external-link","aria-hidden":"true","children":[["$","path","1q9fwt",{"d":"M15 3h6v6"}],["$","path","gplh6r",{"d":"M10 14 21 3"}],["$","path","a6xqqp",{"d":"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}],"$undefined"]}]]}],["$","span",null,{"className":"text-sm text-muted","children":["æ›´æ–°äºŽ"," ","2026-06-06"]}]]}]]}]}],["$","section",null,{"className":"mx-auto grid max-w-6xl gap-8 px-5 py-12 lg:grid-cols-[minmax(0,1fr)_330px]","children":[["$","article",null,{"className":"space-y-8","children":[["$","section",null,{"className":"rounded-lg border border-line bg-white p-6","children":[["$","h2",null,{"className":"text-2xl font-semibold text-ink","children":"é€‚ç”¨åœºæ™¯"}],["$","p",null,{"className":"mt-4 leading-8 text-muted","children":"é€‚åˆæ­£åœ¨æŠŠå›¾ç‰‡ç”ŸæˆæŽ¥å…¥åˆ°åŽç«¯æœåŠ¡ã€è‡ªåŠ¨åŒ–è„šæœ¬æˆ–å†…éƒ¨å·¥å…·çš„å¼€å‘è€…ã€‚ä½ å¯ä»¥åœ¨è¿™é‡Œç¡®è®¤æ¨¡åž‹åã€ç”Ÿæˆç«¯ç‚¹ã€å¸¸ç”¨å‚æ•°ã€ä»·æ ¼å£å¾„å’Œæœ€å°å¯è¿è¡Œç¤ºä¾‹ã€‚"}]]}],["$","section",null,{"className":"rounded-lg border border-line bg-white p-6","children":[["$","div",null,{"className":"flex flex-col gap-2 md:flex-row md:items-end md:justify-between","children":[["$","div",null,{"children":[["$","h2",null,{"className":"text-2xl font-semibold text-ink","children":"æ ‡å‡†æ¨¡åž‹åä¸Žä»·æ ¼"}],["$","p",null,{"className":"mt-2 leading-7 text-muted","children":["æ¥æºï¼šGET https://cn.crazyrouter.com/api/pricingï¼Œå¿«ç…§æ—¥æœŸ"," ","2026-06-06","."]}]]}],["$","div",null,{"className":"rounded-md border border-line bg-panel px-3 py-2 text-sm font-medium text-ink","children":"POST /v1/images/generations"}]]}],["$","div",null,{"className":"mt-5 grid gap-4 md:grid-cols-2","children":[["$","div","gpt-image-2",{"className":"rounded-lg border border-line bg-panel p-4","children":[["$","$L2",null,{"value":"gpt-image-2","label":"å¤åˆ¶æ ‡å‡†æ¨¡åž‹å gpt-image-2","className":"text-base font-semibold"}],["$","div",null,{"className":"mt-2 text-sm text-muted","children":"$$0.0377/image after 0.65x discount"}],["$","div",null,{"className":"mt-3 grid gap-2 text-xs text-muted","children":[["$","div",null,{"children":["è®¡è´¹æ–¹å¼",": ","per_image"]}],["$","div",null,{"children":["å…¬å¼€ç«¯ç‚¹ç±»åž‹",": ","image-generation"]}],["$","div",null,{"children":["æ”¯æŒç«¯ç‚¹ç±»åž‹",": ","image-generation, openai"]}],null]}]]}]]}]]}],null,[["$","section","æŽ¥å…¥å‰å…ˆç¡®è®¤ä¸‰ä»¶äº‹",{"className":"rounded-lg border border-line bg-white p-6","children":[["$","h2",null,{"className":"text-2xl font-semibold text-ink","children":"æŽ¥å…¥å‰å…ˆç¡®è®¤ä¸‰ä»¶äº‹"}],["$","p",null,{"className":"mt-4 leading-8 text-muted","children":"gpt-image-2 èµ° OpenAI Images å…¼å®¹æŽ¥å£ã€‚æ–°æŽ¥å…¥æ—¶å…ˆå›ºå®šæ¨¡åž‹åã€Base URL å’Œç”Ÿæˆç«¯ç‚¹ï¼Œå†æ ¹æ®ä¸šåŠ¡éœ€è¦å¢žåŠ  sizeã€qualityã€output_format ç­‰å‚æ•°ã€‚"}],["$","ul",null,{"className":"mt-5 grid gap-3","children":[["$","li","æ¨¡åž‹åï¼šgpt-image-2ã€‚",{"className":"flex gap-3 text-muted","children":[["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-circle-check mt-1 h-5 w-5 flex-none text-brand","aria-hidden":"true","children":[["$","circle","1mglay",{"cx":"12","cy":"12","r":"10"}],["$","path","dzmm74",{"d":"m9 12 2 2 4-4"}],"$undefined"]}],["$","span",null,{"children":"æ¨¡åž‹åï¼šgpt-image-2ã€‚"}]]}],["$","li","OpenAI å…¼å®¹ Base URLï¼šhttps://cn.crazyrouter.com/v1ã€‚",{"className":"flex gap-3 text-muted","children":[["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-circle-check mt-1 h-5 w-5 flex-none text-brand","aria-hidden":"true","children":[["$","circle","1mglay",{"cx":"12","cy":"12","r":"10"}],["$","path","dzmm74",{"d":"m9 12 2 2 4-4"}],"$undefined"]}],["$","span",null,{"children":"OpenAI å…¼å®¹ Base URLï¼šhttps://cn.crazyrouter.com/v1ã€‚"}]]}],["$","li","å›¾ç‰‡ç”Ÿæˆç«¯ç‚¹ï¼šPOST https://cn.crazyrouter.com/v1/images/generationsã€‚",{"className":"flex gap-3 text-muted","children":[["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-circle-check mt-1 h-5 w-5 flex-none text-brand","aria-hidden":"true","children":[["$","circle","1mglay",{"cx":"12","cy":"12","r":"10"}],["$","path","dzmm74",{"d":"m9 12 2 2 4-4"}],"$undefined"]}],["$","span",null,{"children":"å›¾ç‰‡ç”Ÿæˆç«¯ç‚¹ï¼šPOST https://cn.crazyrouter.com/v1/images/generationsã€‚"}]]}]]}]]}],["$","section","ç”Ÿæˆå›¾ç‰‡çš„æŽ¨èè¯·æ±‚æ–¹å¼",{"className":"rounded-lg border border-line bg-white p-6","children":[["$","h2",null,{"className":"text-2xl font-semibold text-ink","children":"ç”Ÿæˆå›¾ç‰‡çš„æŽ¨èè¯·æ±‚æ–¹å¼"}],["$","p",null,{"className":"mt-4 leading-8 text-muted","children":"æœ€å°è¯·æ±‚åªéœ€è¦ modelã€prompt å’Œ nã€‚éœ€è¦æŽ§åˆ¶å°ºå¯¸æ—¶ä½¿ç”¨ sizeï¼›éœ€è¦æŽ§åˆ¶è´¨é‡æ—¶ä½¿ç”¨ qualityï¼›éœ€è¦æŒ‡å®šæ–‡ä»¶æ ¼å¼æ—¶ä½¿ç”¨ output_formatã€‚å“åº”é»˜è®¤ä»Ž data[0].url è¯»å–å›¾ç‰‡åœ°å€ã€‚"}],["$","ul",null,{"className":"mt-5 grid gap-3","children":[["$","li","size å¯ä½¿ç”¨ auto æˆ–å®½xé«˜ï¼Œä¾‹å¦‚ 1024x1024ã€1536x1024ã€1024x1536ã€‚",{"className":"flex gap-3 text-muted","children":[["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-circle-check mt-1 h-5 w-5 flex-none text-brand","aria-hidden":"true","children":[["$","circle","1mglay",{"cx":"12","cy":"12","r":"10"}],["$","path","dzmm74",{"d":"m9 12 2 2 4-4"}],"$undefined"]}],["$","span",null,{"children":"size å¯ä½¿ç”¨ auto æˆ–å®½xé«˜ï¼Œä¾‹å¦‚ 1024x1024ã€1536x1024ã€1024x1536ã€‚"}]]}],["$","li","quality å¯ä½¿ç”¨ autoã€lowã€mediumã€highï¼›æ—§å®¢æˆ·ç«¯ä¼  standard æ—¶æœåŠ¡ç«¯ä¼šå½’ä¸€ä¸º autoã€‚",{"className":"flex gap-3 text-muted","children":[["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-circle-check mt-1 h-5 w-5 flex-none text-brand","aria-hidden":"true","children":[["$","circle","1mglay",{"cx":"12","cy":"12","r":"10"}],["$","path","dzmm74",{"d":"m9 12 2 2 4-4"}],"$undefined"]}],["$","span",null,{"children":"quality å¯ä½¿ç”¨ autoã€lowã€mediumã€highï¼›æ—§å®¢æˆ·ç«¯ä¼  standard æ—¶æœåŠ¡ç«¯ä¼šå½’ä¸€ä¸º autoã€‚"}]]}],["$","li","output_format å¯ä½¿ç”¨ pngã€jpeg æˆ– webpï¼›å¦‚æžœè¦åŽ‹ç¼© jpeg/webpï¼Œå†é…åˆ output_compressionã€‚",{"className":"flex gap-3 text-muted","children":[["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-circle-check mt-1 h-5 w-5 flex-none text-brand","aria-hidden":"true","children":[["$","circle","1mglay",{"cx":"12","cy":"12","r":"10"}],["$","path","dzmm74",{"d":"m9 12 2 2 4-4"}],"$undefined"]}],["$","span",null,{"children":"output_format å¯ä½¿ç”¨ pngã€jpeg æˆ– webpï¼›å¦‚æžœè¦åŽ‹ç¼© jpeg/webpï¼Œå†é…åˆ output_compressionã€‚"}]]}]]}]]}],["$","section","ç¼–è¾‘å›¾ç‰‡å’Œå¤šå›¾å‚è€ƒ",{"className":"rounded-lg border border-line bg-white p-6","children":[["$","h2",null,{"className":"text-2xl font-semibold text-ink","children":"ç¼–è¾‘å›¾ç‰‡å’Œå¤šå›¾å‚è€ƒ"}],["$","p",null,{"className":"mt-4 leading-8 text-muted","children":"å¦‚æžœè¦ç¼–è¾‘å·²æœ‰å›¾ç‰‡ï¼Œä½¿ç”¨ POST /v1/images/editsï¼Œå¹¶ç”¨ multipart/form-data ä¸Šä¼  image æˆ– image[]ã€‚gpt-image-2 æœ€å¤šæ”¯æŒ 16 å¼ å‚è€ƒå›¾ï¼Œé€‚åˆåšå±€éƒ¨ç¼–è¾‘ã€é£Žæ ¼å‚è€ƒå’Œå¤šå›¾èžåˆã€‚"}],null]}]],["$","section",null,{"className":"rounded-lg border border-line bg-white p-6","children":[["$","h2",null,{"className":"flex items-center gap-2 text-2xl font-semibold text-ink","children":[["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-shield-check h-6 w-6 text-brand","aria-hidden":"true","children":[["$","path","oel41y",{"d":"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["$","path","dzmm74",{"d":"m9 12 2 2 4-4"}],"$undefined"]}],"cn.crazyrouter.com å®žæµ‹è¯æ®"]}],["$","p",null,{"className":"mt-3 leading-7 text-muted","children":"è¿™é‡Œåªå±•ç¤ºè¿”å›ž 200 çš„æ£€æŸ¥ç»“æžœã€‚API è¯·æ±‚ä½¿ç”¨ https://cn.crazyrouter.comï¼›è´¦å·ã€å……å€¼å’ŒæŽ§åˆ¶å°ä½¿ç”¨ https://crazyrouter.comã€‚"}],["$","div",null,{"className":"mt-5 overflow-hidden rounded-lg border border-line","children":["$","table",null,{"className":"w-full text-left text-sm","children":[["$","thead",null,{"className":"bg-panel text-muted","children":["$","tr",null,{"children":[["$","th",null,{"className":"px-4 py-3 font-medium","children":"æ£€æŸ¥é¡¹"}],["$","th",null,{"className":"px-4 py-3 font-medium","children":"è¯·æ±‚"}],["$","th",null,{"className":"px-4 py-3 font-medium","children":"çŠ¶æ€"}],["$","th",null,{"className":"px-4 py-3 font-medium","children":"ç»“æžœ"}]]}]}],["$","tbody",null,{"className":"divide-y divide-line","children":[["$","tr","GET-https://cn.crazyrouter.com/api/pricing-ä»·æ ¼ API è¿”å›ž 200",{"children":[["$","td",null,{"className":"px-4 py-3 font-medium text-ink","children":"ä»·æ ¼ API è¿”å›ž 200"}],["$","td",null,{"className":"px-4 py-3 text-muted","children":["GET"," ","https://cn.crazyrouter.com/api/pricing"]}],["$","td",null,{"className":"px-4 py-3 text-ink","children":"200"}],["$","td",null,{"className":"px-4 py-3 text-muted","children":"å·²è¿”å›žå½“å‰æŒ‡å—ä½¿ç”¨çš„æ¨¡åž‹ä»·æ ¼ã€ç«¯ç‚¹ç±»åž‹å’Œè®¡è´¹æ–¹å¼ã€‚"}]]}],["$","tr","GET-https://cn.crazyrouter.com/v1/models-æ¨¡åž‹åˆ—è¡¨è¿”å›ž 200",{"children":[["$","td",null,{"className":"px-4 py-3 font-medium text-ink","children":"æ¨¡åž‹åˆ—è¡¨è¿”å›ž 200"}],["$","td",null,{"className":"px-4 py-3 text-muted","children":["GET"," ","https://cn.crazyrouter.com/v1/models"]}],["$","td",null,{"className":"px-4 py-3 text-ink","children":"200"}],["$","td",null,{"className":"px-4 py-3 text-muted","children":"å·²è¿”å›žç›®æ ‡æ¨¡åž‹åˆ—è¡¨ï¼ŒåŒ…å«æœ¬ç»„æŒ‡å—ä½¿ç”¨çš„å›¾ç‰‡ä¸Žè§†é¢‘æ¨¡åž‹ã€‚"}]]}]]}]]}]}]]}],["$","section",null,{"className":"rounded-lg border border-line bg-white p-6","children":[["$","h2",null,{"className":"flex items-center gap-2 text-2xl font-semibold text-ink","children":[["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-code-xml h-6 w-6 text-brand","aria-hidden":"true","children":[["$","path","1inbqp",{"d":"m18 16 4-4-4-4"}],["$","path","15zrgr",{"d":"m6 8-4 4 4 4"}],["$","path","e7oirm",{"d":"m14.5 4-5 16"}],"$undefined"]}],"æŽ¥å…¥ç¤ºä¾‹"]}],["$","div",null,{"className":"mt-5 grid gap-5","children":[["$","div","cURL",{"className":"overflow-hidden rounded-lg border border-line","children":[["$","div",null,{"className":"border-b border-line bg-panel px-4 py-2 text-sm font-semibold text-ink","children":"cURL"}],["$","pre",null,{"className":"overflow-x-auto bg-ink p-4 text-sm leading-6 text-white","children":["$","code",null,{"children":"curl -X POST https://cn.crazyrouter.com/v1/images/generations \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -d '{\n    \"model\": \"gpt-image-2\",\n    \"prompt\": \"A clean product photo of a ceramic coffee mug on a white background\",\n    \"n\": 1\n  }'"}]}]]}],["$","div","Python",{"className":"overflow-hidden rounded-lg border border-line","children":[["$","div",null,{"className":"border-b border-line bg-panel px-4 py-2 text-sm font-semibold text-ink","children":"Python"}],["$","pre",null,{"className":"overflow-x-auto bg-ink p-4 text-sm leading-6 text-white","children":["$","code",null,{"children":"from openai import OpenAI\n\nclient = OpenAI(\n    api_key=\"YOUR_API_KEY\",\n    base_url=\"https://cn.crazyrouter.com/v1\",\n)\n\nresponse = client.images.generate(\n    model=\"gpt-image-2\",\n    prompt=\"A clean product photo of a ceramic coffee mug on a white background\",\n    n=1,\n)\n\nprint(response.data[0].url)"}]}]]}]]}]]}],["$","section",null,{"className":"rounded-lg border border-line bg-white p-6","children":[["$","h2",null,{"className":"text-2xl font-semibold text-ink","children":"è¡¥å……è¯´æ˜Ž"}],["$","div",null,{"className":"mt-5 divide-y divide-line","children":[["$","div","è¿™äº›ä»·æ ¼æ¥è‡ªå“ªé‡Œï¼Ÿ",{"className":"py-5 first:pt-0 last:pb-0","children":[["$","h3",null,{"className":"font-semibold text-ink","children":"è¿™äº›ä»·æ ¼æ¥è‡ªå“ªé‡Œï¼Ÿ"}],["$","p",null,{"className":"mt-2 leading-7 text-muted","children":"ä»·æ ¼å¡ç‰‡æ¥è‡ª Crazyrouter ä»·æ ¼é¡µå¯¹åº”çš„ GET https://cn.crazyrouter.com/api/pricing å¿«ç…§ï¼Œç”¨æ¥å±•ç¤ºå½“å‰å…¬å¼€æ¨¡åž‹åã€ç«¯ç‚¹ç±»åž‹å’Œè®¡è´¹æ–¹å¼ã€‚"}]]}],["$","div","OpenAI SDK åº”è¯¥é…ç½®å“ªä¸ª Base URLï¼Ÿ",{"className":"py-5 first:pt-0 last:pb-0","children":[["$","h3",null,{"className":"font-semibold text-ink","children":"OpenAI SDK åº”è¯¥é…ç½®å“ªä¸ª Base URLï¼Ÿ"}],["$","p",null,{"className":"mt-2 leading-7 text-muted","children":"OpenAI å…¼å®¹ SDK ä½¿ç”¨ https://cn.crazyrouter.com/v1ï¼›æ‰‹å†™ cURL ä½¿ç”¨å®Œæ•´è·¯å¾„ï¼Œä¾‹å¦‚ https://cn.crazyrouter.com/v1/images/generationsã€‚"}]]}],["$","div","gpt-image-2 å¯ä»¥ç›´æŽ¥ä½¿ç”¨ size å’Œ quality å—ï¼Ÿ",{"className":"py-5 first:pt-0 last:pb-0","children":[["$","h3",null,{"className":"font-semibold text-ink","children":"gpt-image-2 å¯ä»¥ç›´æŽ¥ä½¿ç”¨ size å’Œ quality å—ï¼Ÿ"}],["$","p",null,{"className":"mt-2 leading-7 text-muted","children":"å¯ä»¥ã€‚å½“å‰ GPT Image æ–‡æ¡£æ”¯æŒ size å’Œ qualityã€‚size å¯ä»¥æ˜¯ auto æˆ–ç¬¦åˆé™åˆ¶çš„å®½xé«˜ï¼›quality å¯ä»¥æ˜¯ autoã€lowã€mediumã€highï¼Œæ—§å®¢æˆ·ç«¯ä¼  standard æ—¶ä¼šè¢«å½’ä¸€ä¸º autoã€‚"}]]}]]}]]}]]}],["$","aside",null,{"className":"space-y-6","children":[["$","div",null,{"className":"rounded-lg border border-line bg-white p-5","children":[["$","h2",null,{"className":"text-base font-semibold text-ink","children":"ç›¸å…³æ–‡æ¡£"}],["$","div",null,{"className":"mt-4 space-y-3","children":[["$","a","crazyrouter-docs/images/gpt-image.mdx",{"href":"https://docs.crazyrouter.com/images/gpt-image","className":"block rounded-md border border-line bg-panel p-3 text-xs leading-5 text-muted hover:border-brand hover:text-ink","children":[["$","span",null,{"className":"flex items-center gap-2 font-semibold text-ink","children":["GPT Image æ–‡æ¡£",["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":12,"height":12,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-external-link","aria-hidden":"true","children":[["$","path","1q9fwt",{"d":"M15 3h6v6"}],["$","path","gplh6r",{"d":"M10 14 21 3"}],["$","path","a6xqqp",{"d":"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}],"$undefined"]}]]}],["$","span",null,{"className":"mt-1 block break-words","children":"https://docs.crazyrouter.com/images/gpt-image"}]]}],["$","a","crazyrouter-docs/api-endpoint.mdx",{"href":"https://docs.crazyrouter.com/api-endpoint","className":"block rounded-md border border-line bg-panel p-3 text-xs leading-5 text-muted hover:border-brand hover:text-ink","children":[["$","span",null,{"className":"flex items-center gap-2 font-semibold text-ink","children":["API æŽ¥å…¥åœ°å€",["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":12,"height":12,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-external-link","aria-hidden":"true","children":[["$","path","1q9fwt",{"d":"M15 3h6v6"}],["$","path","gplh6r",{"d":"M10 14 21 3"}],["$","path","a6xqqp",{"d":"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}],"$undefined"]}]]}],["$","span",null,{"className":"mt-1 block break-words","children":"https://docs.crazyrouter.com/api-endpoint"}]]}],["$","a","crazyrouter-docs/llms-guide.mdx",{"href":"https://docs.crazyrouter.com/llms-guide","className":"block rounded-md border border-line bg-panel p-3 text-xs leading-5 text-muted hover:border-brand hover:text-ink","children":[["$","span",null,{"className":"flex items-center gap-2 font-semibold text-ink","children":["llms.txt æ–‡æ¡£ç´¢å¼•",["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","width":12,"height":12,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-external-link","aria-hidden":"true","children":[["$","path","1q9fwt",{"d":"M15 3h6v6"}],["$","path","gplh6r",{"d":"M10 14 21 3"}],["$","path","a6xqqp",{"d":"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}],"$undefined"]}]]}],["$","span",null,{"className":"mt-1 block break-words","children":"https://docs.crazyrouter.com/llms-guide"}]]}]]}]]}],["$","div",null,{"className":"rounded-lg border border-line bg-white p-5","children":[["$","h2",null,{"className":"text-base font-semibold text-ink","children":"ç›¸å…³ä¸­æ–‡æŒ‡å—"}],["$","div",null,{"className":"mt-4 space-y-3","children":[["$","$L3","nano-banana-2-api",{"href":"/zh/guide/nano-banana-2-api","className":"block rounded-md border border-line p-3 text-sm font-medium text-ink hover:border-brand","children":"Nano Banana 2 API ä¸­æ–‡æŽ¥å…¥æŒ‡å—"}],["$","$L3","grok-4-image-api",{"href":"/zh/guide/grok-4-image-api","className":"block rounded-md border border-line p-3 text-sm font-medium text-ink hover:border-brand","children":"Grok 4 Image API ä¸­æ–‡æŽ¥å…¥æŒ‡å—"}],["$","$L3","ai-api-cost-calculator",{"href":"/zh/guide/ai-api-cost-calculator","className":"block rounded-md border border-line p-3 text-sm font-medium text-ink hover:border-brand","children":"AI API æˆæœ¬è®¡ç®—å™¨"}]]}]]}]]}]]}]]}]],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","zh","children","guide","children","$5","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","zh","children","guide","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","zh","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/guide-assets/_next/static/css/9912b6ef9196c604.css?dpl=dpl_5ZVBoSNL85fYNKdMCBs4NvdoKA98","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":[["$","$L7",null,{}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],["$","$L8",null,{}]]}]}]],null],null],["$L9",null]]]]
9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"GPT Image 2 API ä¸­æ–‡æŽ¥å…¥æŒ‡å— | Crazyrouter"}],["$","meta","3",{"name":"description","content":"ä½¿ç”¨ Crazyrouter æŽ¥å…¥ gpt-image-2ï¼šåŒ…å« OpenAI Images å…¼å®¹ç«¯ç‚¹ã€ä»·æ ¼é¡µæ¨¡åž‹æ•°æ®ã€å‚æ•°é™åˆ¶å’Œå¯å¤æŸ¥çš„æŽ¥å£è¯æ®ã€‚"}],["$","meta","4",{"name":"keywords","content":"gpt-image-2 api,gpt image api,openai å›¾ç‰‡ç”Ÿæˆ api,gpt-image-2 ä»·æ ¼"}],["$","link","5",{"rel":"canonical","href":"https://crazyrouter.com/zh/guide/gpt-image-2-api"}],["$","link","6",{"rel":"alternate","hrefLang":"en","href":"https://crazyrouter.com/guide/gpt-image-2-api"}],["$","link","7",{"rel":"alternate","hrefLang":"zh-CN","href":"https://crazyrouter.com/zh/guide/gpt-image-2-api"}],["$","meta","8",{"property":"og:title","content":"GPT Image 2 API ä¸­æ–‡æŽ¥å…¥æŒ‡å— | Crazyrouter"}],["$","meta","9",{"property":"og:description","content":"ä½¿ç”¨ Crazyrouter æŽ¥å…¥ gpt-image-2ï¼šåŒ…å« OpenAI Images å…¼å®¹ç«¯ç‚¹ã€ä»·æ ¼é¡µæ¨¡åž‹æ•°æ®ã€å‚æ•°é™åˆ¶å’Œå¯å¤æŸ¥çš„æŽ¥å£è¯æ®ã€‚"}],["$","meta","10",{"property":"og:url","content":"https://crazyrouter.com/zh/guide/gpt-image-2-api"}],["$","meta","11",{"property":"og:locale","content":"zh_CN"}],["$","meta","12",{"property":"og:type","content":"article"}],["$","meta","13",{"name":"twitter:card","content":"summary"}],["$","meta","14",{"name":"twitter:title","content":"GPT Image 2 API ä¸­æ–‡æŽ¥å…¥æŒ‡å— | Crazyrouter"}],["$","meta","15",{"name":"twitter:description","content":"ä½¿ç”¨ Crazyrouter æŽ¥å…¥ gpt-image-2ï¼šåŒ…å« OpenAI Images å…¼å®¹ç«¯ç‚¹ã€ä»·æ ¼é¡µæ¨¡åž‹æ•°æ®ã€å‚æ•°é™åˆ¶å’Œå¯å¤æŸ¥çš„æŽ¥å£è¯æ®ã€‚"}]]
1:null
