Jiniu AIJiniu AI
Docs
ImagesNative Gemini format

Gemini image generation (OpenAI-compatible)

Gemini image generation

POST
/v1/chat/completions

Request Body

application/json

model*string

Model ID

messages*

Conversation messages, in chronological order

temperature?number

Sampling temperature

Default1
Range0 <= value <= 2
top_p?number

Nucleus sampling parameter

Default1
Range0 <= value <= 1
n?integer

Number of results to generate

Default1
Range1 <= value
stream?boolean

Whether to stream the response

Defaultfalse
stream_options?

Streaming options

stop?string|

Stop sequences

max_tokens?integer

Maximum tokens to generate

max_completion_tokens?integer

Maximum completion tokens

presence_penalty?number

Presence penalty, -2.0–2.0. Positive values push the model toward new topics

Default0
Range-2 <= value <= 2
frequency_penalty?number

Frequency penalty, -2.0–2.0. Positive values reduce repeated wording

Default0
Range-2 <= value <= 2
logit_bias?

Bias map adjusting the likelihood of specific tokens, keyed by token ID

user?string

End-user identifier for abuse tracing (OpenAI now recommends safety_identifier instead)

tools?

Tools the model may call

tool_choice?string|

Tool choice: auto, none, or a specific tool

response_format?

Response format. Set json_schema to enable structured outputs that strictly match the given schema

seed?integer

Random seed. The same seed and parameters make a best effort to reproduce results

reasoning_effort?string

Reasoning effort, for models that support reasoning

Value in"low" | "medium" | "high"
modalities?array<string>

Expected output modalities, e.g. ["text"] or ["text","audio"]

audio?

Audio output settings; required when requesting the audio modality

Response Body

application/json

application/json

application/json

curl -X POST "https://jiniu.ai/v1/chat/completions" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-4",    "messages": [      {        "role": "system",        "content": "string"      }    ]  }'
{
  "id": "string",
  "object": "chat.completion",
  "created": 0,
  "model": "string",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "system",
        "content": "string",
        "name": "string",
        "tool_calls": [
          {
            "id": "string",
            "type": "function",
            "function": {
              "name": "string",
              "arguments": "string"
            }
          }
        ],
        "tool_call_id": "string",
        "reasoning_content": "string"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "text_tokens": 0,
      "audio_tokens": 0,
      "image_tokens": 0
    },
    "completion_tokens_details": {
      "text_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 0
    }
  },
  "system_fingerprint": "string"
}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}