Skip to Content
API ReferenceChatChat (non-stream)

Chat Completion response object

Single Chat Completion response returned by the model.

Attributes

  • id string
    Chat response ID.
  • object string
    Response object type, always chat.completion.
  • model string
    Model name.
  • created timestamp
    Unix timestamp (seconds) when the response was generated.
  • choices object array
    List of response choices.
    Expand/Collapse
    • finish_reason string
      Why generation stopped.
    • index int
      Choice index.
    • message object
      Actual message content.
    Expand/Collapse
    • role string
      Message role, always assistant.
    • content string
      Message text.
    • reasoning string
      Reasoning content (only for step reasoning models).
    • tool_calls object array optional
      Toolcall results.
    Expand/Collapse
    • id string
      Function call ID generated by the model; unique in context.
    • type string
      Toolcall type, always function.
    • function object
      Function payload.
    Expand/Collapse
    • name string
      Function name, typically one from the tools list of the previous turn.
    • arguments string
      Function arguments as a JSON string.
  • usage object
    Token usage statistics.
    Expand/Collapse
    • prompt_tokens int
      Prompt tokens used.
    • cached_tokens int optional
      Prompt tokens served from cache.
    • completion_tokens int
      Completion tokens generated.
    • total_tokens int
      Total tokens.

Example

{ "id": "b7b56af0-52a6-483f-a589-948182676a1b", "object": "chat.completion", "created": 1709893411, "model": "step-3.5-flash", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! StepFun specializes in artificial intelligence and provides AI solutions across NLP, computer vision, and machine learning to help customers improve efficiency and create value across industries." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 83, "completion_tokens": 176, "total_tokens": 259 } }
Last updated on