{
  "openapi": "3.1.0",
  "info": {
    "title": "Responses API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.cometapi.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/responses": {
      "post": {
        "summary": "Create Response",
        "operationId": "createResponse",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID to use for this request. See the [Models page](/overview/models) for current options.",
                    "example": "gpt-6-astra",
                    "default": "gpt-6-astra"
                  },
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "description": "A plain text string as input."
                      },
                      {
                        "type": "array",
                        "description": "An array of input items with roles and multimodal content.",
                        "items": {
                          "type": "object"
                        }
                      }
                    ],
                    "description": "Text, image, or file inputs to the model, used to generate a response. Can be a simple string for text-only input, or an array of input items for multimodal content (images, files) and multi-turn conversations."
                  },
                  "instructions": {
                    "type": "string",
                    "description": "A system (or developer) message inserted into the model's context. When used with `previous_response_id`, instructions from the previous response are not carried over — this makes it easy to swap system messages between turns."
                  },
                  "background": {
                    "type": "boolean",
                    "description": "Whether to run the model response in the background. Background responses do not return output directly — you retrieve the result later via the response ID."
                  },
                  "context_management": {
                    "type": "array",
                    "description": "Context management configuration for this request. Controls how the model manages context when the conversation exceeds the context window.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "The type of context management."
                        },
                        "compact_threshold": {
                          "type": "number",
                          "description": "The threshold at which context compaction is triggered."
                        }
                      }
                    }
                  },
                  "conversation": {
                    "type": [
                      "string",
                      "object",
                      "null"
                    ],
                    "description": "The conversation this response belongs to. Items from the conversation are prepended to `input` for context. Input and output items are automatically added to the conversation after the response completes. Cannot be used with `previous_response_id`."
                  },
                  "include": {
                    "type": "array",
                    "description": "Additional output data to include in the response. Use this to request extra information that is not included by default.",
                    "items": {
                      "type": "string",
                      "enum": [
                        "web_search_call.action.sources",
                        "code_interpreter_call.outputs",
                        "computer_call_output.output.image_url",
                        "file_search_call.results",
                        "message.input_image.image_url",
                        "message.output_text.logprobs",
                        "reasoning.encrypted_content"
                      ]
                    }
                  },
                  "max_output_tokens": {
                    "type": "integer",
                    "description": "An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens."
                  },
                  "max_tool_calls": {
                    "type": "integer",
                    "description": "The maximum number of total calls to built-in tools that can be processed in a response. This limit applies across all built-in tool calls, not per individual tool. Any further tool call attempts by the model will be ignored."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Set of up to 16 key-value pairs that can be attached to the response. Useful for storing additional information in a structured format. Keys have a maximum length of 64 characters; values have a maximum length of 512 characters.",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "parallel_tool_calls": {
                    "type": "boolean",
                    "description": "Whether to allow the model to run tool calls in parallel."
                  },
                  "previous_response_id": {
                    "type": "string",
                    "description": "An ID for a stored response that is accessible to the selected model and request context. Cannot be combined with conversation. The conversation-history example sends prior input and output items explicitly."
                  },
                  "prompt": {
                    "type": "object",
                    "description": "Reference to a prompt template and its variables.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "The ID of the prompt template."
                      },
                      "variables": {
                        "type": "object",
                        "description": "Key-value pairs for template variables.",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "version": {
                        "type": "string",
                        "description": "The version of the prompt template to use."
                      }
                    }
                  },
                  "prompt_cache_key": {
                    "type": "string",
                    "description": "A key used to cache responses for similar requests, helping optimize cache hit rates. Replaces the deprecated `user` field for caching purposes."
                  },
                  "prompt_cache_retention": {
                    "type": "string",
                    "description": "Legacy prompt-cache retention setting. Refer to the selected model documentation for prompt_cache_options and supported retention settings.",
                    "enum": [
                      "in_memory",
                      "24h"
                    ],
                    "deprecated": true
                  },
                  "reasoning": {
                    "type": "object",
                    "description": "Reasoning configuration for the selected model.",
                    "properties": {
                      "effort": {
                        "type": "string",
                        "description": "Model-dependent reasoning effort. The examples use low for general tasks and high for the reasoning example. See the selected model reference for supported levels."
                      },
                      "generate_summary": {
                        "type": "string",
                        "description": "Deprecated alias. Use summary for a reasoning summary when supported.",
                        "enum": [
                          "auto",
                          "concise",
                          "detailed"
                        ],
                        "deprecated": true
                      },
                      "summary": {
                        "type": "string",
                        "description": "Request a summary of the model reasoning when supported by the selected model.",
                        "enum": [
                          "auto",
                          "concise",
                          "detailed"
                        ]
                      }
                    }
                  },
                  "safety_identifier": {
                    "type": "string",
                    "description": "A stable identifier for your end-users, used to help detect policy violations. Should be a hashed username or email — do not send identifying information directly.",
                    "maxLength": 64
                  },
                  "service_tier": {
                    "type": "string",
                    "description": "Specifies the processing tier for the request. When set, the response will include the actual `service_tier` used.\n\n- `auto`: Uses the tier configured in project settings (default behavior).\n- `default`: Standard pricing and performance.\n- `flex`: Flexible processing with potential cost savings.\n- `priority`: Priority processing with faster response times.",
                    "enum": [
                      "auto",
                      "default",
                      "flex",
                      "priority"
                    ]
                  },
                  "store": {
                    "type": "boolean",
                    "description": "Request response storage for later retrieval, when supported by the selected model and request context."
                  },
                  "stream": {
                    "type": "boolean",
                    "description": "If set to `true`, the response data will be streamed to the client as it is generated using server-sent events (SSE). Events include `response.created`, `response.output_text.delta`, `response.completed`, and more."
                  },
                  "stream_options": {
                    "type": "object",
                    "description": "Options for streaming responses. Only set this when `stream` is `true`.",
                    "properties": {
                      "include_obfuscation": {
                        "type": "boolean",
                        "description": "Whether to include obfuscation data in streaming events."
                      }
                    }
                  },
                  "temperature": {
                    "type": "number",
                    "description": "Sampling temperature. Omit this field for GPT-6 Astra.",
                    "minimum": 0,
                    "maximum": 2
                  },
                  "text": {
                    "type": "object",
                    "description": "Configuration for text output. Use this to request structured JSON output via JSON mode or JSON Schema.",
                    "properties": {
                      "format": {
                        "type": "object",
                        "description": "The format of the text output.",
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": "The output format type. `text` returns plain text, `json_object` returns valid JSON, `json_schema` returns JSON conforming to a provided schema.",
                            "enum": [
                              "text",
                              "json_object",
                              "json_schema"
                            ]
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the output schema when type is json_schema."
                          },
                          "schema": {
                            "type": "object",
                            "description": "JSON Schema describing the requested output when type is json_schema."
                          },
                          "strict": {
                            "type": "boolean",
                            "description": "Require the supported JSON Schema to be followed for a completed, non-refusal structured response."
                          }
                        }
                      },
                      "verbosity": {
                        "type": "string",
                        "description": "Controls the verbosity of the text output.",
                        "enum": [
                          "low",
                          "medium",
                          "high"
                        ]
                      }
                    }
                  },
                  "tool_choice": {
                    "type": [
                      "string",
                      "object"
                    ],
                    "description": "Controls how the model selects which tool(s) to call.\n\n- `auto` (default): The model decides whether and which tools to call.\n- `none`: The model will not call any tools.\n- `required`: The model must call at least one tool.\n- An object specifying a particular tool to use."
                  },
                  "tools": {
                    "type": "array",
                    "description": "Tools available to the model. This page demonstrates web_search and custom function tools. Other tool types require their own configuration; see the official tool reference.",
                    "items": {
                      "type": "object"
                    }
                  },
                  "top_logprobs": {
                    "type": "integer",
                    "description": "Number of token alternatives to include for models supporting log probabilities. Requires message.output_text.logprobs in include. Omit for GPT-6 Astra.",
                    "minimum": 0,
                    "maximum": 20
                  },
                  "top_p": {
                    "type": "number",
                    "description": "Nucleus sampling threshold. Omit this field for GPT-6 Astra. For sampling overrides, adjust either top_p or temperature.",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "truncation": {
                    "type": "string",
                    "description": "The truncation strategy for handling inputs that exceed the model's context window.\n\n- `auto`: The model truncates the input by dropping items from the beginning of the conversation to fit.\n- `disabled` (default): The request fails with a 400 error if the input exceeds the context window.",
                    "enum": [
                      "auto",
                      "disabled"
                    ]
                  },
                  "user": {
                    "type": "string",
                    "description": "Deprecated. Use `safety_identifier` and `prompt_cache_key` instead. A stable identifier for your end-user.",
                    "deprecated": true
                  }
                },
                "default": {
                  "model": "gpt-6-astra",
                  "input": "Tell me a three sentence bedtime story about a unicorn.",
                  "reasoning": {
                    "effort": "low"
                  }
                }
              },
              "examples": {
                "Text Input": {
                  "summary": "Text Input",
                  "value": {
                    "model": "gpt-6-astra",
                    "input": "Tell me a three sentence bedtime story about a unicorn.",
                    "reasoning": {
                      "effort": "low"
                    }
                  }
                },
                "Image Input": {
                  "summary": "Image Input",
                  "value": {
                    "model": "gpt-6-astra",
                    "input": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "input_text",
                            "text": "Describe the road and surrounding landscape in this image."
                          },
                          {
                            "type": "input_image",
                            "image_url": "https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=1200"
                          }
                        ]
                      }
                    ],
                    "reasoning": {
                      "effort": "low"
                    }
                  }
                },
                "File Input": {
                  "summary": "File Input",
                  "value": {
                    "model": "gpt-6-astra",
                    "input": [
                      {
                        "role": "user",
                        "content": [
                          {
                            "type": "input_text",
                            "text": "Summarize the main topics in this shareholder letter."
                          },
                          {
                            "type": "input_file",
                            "file_url": "https://www.berkshirehathaway.com/letters/2024ltr.pdf"
                          }
                        ]
                      }
                    ],
                    "reasoning": {
                      "effort": "low"
                    }
                  }
                },
                "Web Search": {
                  "summary": "Web Search",
                  "value": {
                    "model": "gpt-6-astra",
                    "input": "Search the web for the NASA Artemis II mission overview and cite the official NASA page.",
                    "tools": [
                      {
                        "type": "web_search"
                      }
                    ],
                    "reasoning": {
                      "effort": "low"
                    }
                  }
                },
                "Streaming": {
                  "summary": "Streaming",
                  "value": {
                    "model": "gpt-6-astra",
                    "input": "Tell me a three sentence bedtime story about a unicorn.",
                    "reasoning": {
                      "effort": "low"
                    },
                    "stream": true
                  }
                },
                "Functions": {
                  "summary": "Functions",
                  "value": {
                    "model": "gpt-6-astra",
                    "input": "What is the weather in Boston, MA, in celsius? Use the weather tool.",
                    "tools": [
                      {
                        "type": "function",
                        "name": "get_current_weather",
                        "description": "Get the current weather for a city.",
                        "parameters": {
                          "type": "object",
                          "properties": {
                            "location": {
                              "type": "string",
                              "description": "City and state, for example Boston, MA."
                            },
                            "unit": {
                              "type": "string",
                              "enum": [
                                "celsius",
                                "fahrenheit"
                              ],
                              "description": "Temperature unit."
                            }
                          },
                          "required": [
                            "location",
                            "unit"
                          ],
                          "additionalProperties": false
                        },
                        "strict": true
                      }
                    ],
                    "tool_choice": "auto",
                    "reasoning": {
                      "effort": "low"
                    }
                  }
                },
                "Reasoning": {
                  "summary": "Reasoning",
                  "value": {
                    "model": "gpt-6-astra",
                    "input": "Solve this step by step: what is 15% of 240?",
                    "reasoning": {
                      "effort": "high"
                    }
                  }
                },
                "Structured Output": {
                  "summary": "Structured Output",
                  "value": {
                    "model": "gpt-6-astra",
                    "input": "List 3 programming languages with their main use cases.",
                    "text": {
                      "format": {
                        "type": "json_schema",
                        "name": "languages",
                        "strict": true,
                        "schema": {
                          "type": "object",
                          "properties": {
                            "languages": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "description": "Programming language name."
                                  },
                                  "use_case": {
                                    "type": "string",
                                    "description": "Main use case for the language."
                                  }
                                },
                                "required": [
                                  "name",
                                  "use_case"
                                ],
                                "additionalProperties": false
                              },
                              "description": "Three programming languages and their main uses."
                            }
                          },
                          "required": [
                            "languages"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "reasoning": {
                      "effort": "low"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The generated Response object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier for the response.",
                      "example": "resp_example"
                    },
                    "object": {
                      "type": "string",
                      "description": "The object type, always `response`.",
                      "enum": [
                        "response"
                      ],
                      "example": "response"
                    },
                    "created_at": {
                      "type": "integer",
                      "description": "Unix timestamp (in seconds) of when the response was created.",
                      "example": 1788763707
                    },
                    "status": {
                      "type": "string",
                      "description": "The status of the response.",
                      "enum": [
                        "completed",
                        "in_progress",
                        "failed",
                        "cancelled",
                        "queued",
                        "incomplete"
                      ],
                      "example": "completed"
                    },
                    "background": {
                      "type": "boolean",
                      "description": "Whether the response was run in the background.",
                      "example": false
                    },
                    "completed_at": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Unix timestamp of when the response was completed, or `null` if still in progress.",
                      "example": 1788763711
                    },
                    "error": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Error information if the response failed, or `null` on success.",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "The error code."
                        },
                        "message": {
                          "type": "string",
                          "description": "A human-readable error message."
                        }
                      }
                    },
                    "incomplete_details": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Details about why the response is incomplete, if applicable.",
                      "properties": {
                        "reason": {
                          "type": "string",
                          "description": "The reason the response is incomplete.",
                          "enum": [
                            "max_output_tokens",
                            "content_filter"
                          ]
                        }
                      }
                    },
                    "instructions": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The system instructions used for this response."
                    },
                    "max_output_tokens": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "The maximum output token limit that was applied."
                    },
                    "model": {
                      "type": "string",
                      "description": "The model used for the response.",
                      "example": "gpt-6-astra"
                    },
                    "output": {
                      "type": "array",
                      "description": "An array of output items generated by the model. Each item can be a message, function call, or other output type.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier for the output item."
                          },
                          "type": {
                            "type": "string",
                            "description": "The type of output item.",
                            "enum": [
                              "message",
                              "function_call",
                              "web_search_call",
                              "file_search_call",
                              "code_interpreter_call",
                              "computer_call",
                              "reasoning"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "description": "The status of this output item.",
                            "enum": [
                              "completed",
                              "in_progress"
                            ]
                          },
                          "role": {
                            "type": "string",
                            "description": "The role of the message (present when `type` is `message`).",
                            "enum": [
                              "assistant"
                            ]
                          },
                          "content": {
                            "type": "array",
                            "description": "The content parts of the message (present when `type` is `message`).",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "description": "The content type.",
                                  "enum": [
                                    "output_text"
                                  ]
                                },
                                "text": {
                                  "type": "string",
                                  "description": "The generated text content."
                                },
                                "annotations": {
                                  "type": "array",
                                  "description": "Annotations such as file citations or URL citations.",
                                  "items": {
                                    "type": "object"
                                  }
                                },
                                "logprobs": {
                                  "type": "array",
                                  "description": "Log probability information (when requested via `include`).",
                                  "items": {
                                    "type": "object"
                                  }
                                }
                              }
                            }
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the function being called (present when `type` is `function_call`)."
                          },
                          "arguments": {
                            "type": "string",
                            "description": "The JSON-encoded arguments for the function call (present when `type` is `function_call`)."
                          },
                          "call_id": {
                            "type": "string",
                            "description": "The unique call identifier (present when `type` is `function_call`)."
                          },
                          "phase": {
                            "type": "string",
                            "description": "Message phase reported by the model, such as final_answer."
                          }
                        }
                      }
                    },
                    "parallel_tool_calls": {
                      "type": "boolean",
                      "description": "Whether parallel tool calls were enabled."
                    },
                    "previous_response_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The ID of the previous response, if this is a multi-turn conversation."
                    },
                    "reasoning": {
                      "type": "object",
                      "description": "The reasoning configuration that was used.",
                      "properties": {
                        "effort": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The reasoning effort level."
                        },
                        "summary": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The reasoning summary setting."
                        },
                        "context": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Reasoning context mode reported by the model."
                        },
                        "mode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Reasoning execution mode reported by the model."
                        }
                      }
                    },
                    "service_tier": {
                      "type": "string",
                      "description": "The service tier actually used to process the request."
                    },
                    "store": {
                      "type": "boolean",
                      "description": "Whether the response was stored."
                    },
                    "temperature": {
                      "type": "number",
                      "description": "The temperature value used."
                    },
                    "text": {
                      "type": "object",
                      "description": "The text configuration used.",
                      "properties": {
                        "format": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "description": "Format type: `text` (default), `json_object`, or `json_schema`."
                            }
                          },
                          "description": "Output text format configuration."
                        },
                        "verbosity": {
                          "type": "string",
                          "description": "The verbosity level used."
                        }
                      }
                    },
                    "tool_choice": {
                      "type": [
                        "string",
                        "object"
                      ],
                      "description": "The tool choice setting used."
                    },
                    "tools": {
                      "type": "array",
                      "description": "The tools that were available for this response.",
                      "items": {
                        "type": "object"
                      }
                    },
                    "top_p": {
                      "type": "number",
                      "description": "The `top_p` value used."
                    },
                    "truncation": {
                      "type": "string",
                      "description": "The truncation strategy used."
                    },
                    "usage": {
                      "type": "object",
                      "description": "Token usage statistics for this response.",
                      "properties": {
                        "input_tokens": {
                          "type": "integer",
                          "description": "Number of input tokens consumed.",
                          "example": 17
                        },
                        "input_tokens_details": {
                          "type": "object",
                          "description": "Breakdown of input token usage.",
                          "properties": {
                            "cached_tokens": {
                              "type": "integer",
                              "description": "Number of input tokens that were cached.",
                              "example": 0
                            },
                            "cache_write_tokens": {
                              "type": "integer",
                              "description": "Input tokens written to the prompt cache, when reported."
                            }
                          }
                        },
                        "output_tokens": {
                          "type": "integer",
                          "description": "Number of output tokens generated.",
                          "example": 81
                        },
                        "output_tokens_details": {
                          "type": "object",
                          "description": "Breakdown of output token usage.",
                          "properties": {
                            "reasoning_tokens": {
                              "type": "integer",
                              "description": "Number of tokens used for reasoning.",
                              "example": 0
                            }
                          }
                        },
                        "total_tokens": {
                          "type": "integer",
                          "description": "Total number of tokens (input + output).",
                          "example": 98
                        }
                      }
                    },
                    "user": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The user identifier, if provided."
                    },
                    "metadata": {
                      "type": "object",
                      "description": "The metadata attached to this response.",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "content_filters": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "description": "Content filter results applied to the response, if any.",
                      "nullable": true
                    },
                    "frequency_penalty": {
                      "type": "number",
                      "description": "The frequency penalty applied to the request."
                    },
                    "max_tool_calls": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Maximum number of tool calls allowed, if set.",
                      "nullable": true
                    },
                    "presence_penalty": {
                      "type": "number",
                      "description": "The presence penalty applied to the request."
                    },
                    "prompt_cache_key": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Cache key for prompt caching, if applicable.",
                      "nullable": true
                    },
                    "prompt_cache_retention": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Prompt cache retention policy, if applicable.",
                      "nullable": true
                    },
                    "safety_identifier": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Safety system identifier for the response, if applicable.",
                      "nullable": true
                    },
                    "top_logprobs": {
                      "type": "integer",
                      "description": "Number of top log probabilities returned per token position."
                    }
                  }
                },
                "example": {
                  "id": "resp_example",
                  "object": "response",
                  "created_at": 1788763707,
                  "status": "completed",
                  "background": false,
                  "completed_at": 1788763711,
                  "error": null,
                  "incomplete_details": null,
                  "model": "gpt-6-astra",
                  "output": [
                    {
                      "id": "msg_example",
                      "type": "message",
                      "status": "completed",
                      "content": [
                        {
                          "type": "output_text",
                          "annotations": [],
                          "logprobs": [],
                          "text": "A little unicorn named Luna followed a trail of silver fireflies to a meadow where the flowers chimed softly in the breeze. She curled beneath a willow tree, tucked her hooves into the cool grass, and wished sweet dreams for every creature in the forest. As the moon wrapped the meadow in gentle light, Luna closed her eyes and drifted into dreams of dancing among the stars."
                        }
                      ],
                      "phase": "final_answer",
                      "role": "assistant"
                    }
                  ],
                  "parallel_tool_calls": true,
                  "previous_response_id": null,
                  "reasoning": {
                    "context": "all_turns",
                    "effort": "low",
                    "mode": "standard",
                    "summary": null
                  },
                  "store": true,
                  "text": {
                    "format": {
                      "type": "text"
                    },
                    "verbosity": "medium"
                  },
                  "tool_choice": "auto",
                  "tools": [],
                  "usage": {
                    "input_tokens": 17,
                    "input_tokens_details": {
                      "cache_write_tokens": 0,
                      "cached_tokens": 0
                    },
                    "output_tokens": 81,
                    "output_tokens_details": {
                      "reasoning_tokens": 0
                    },
                    "total_tokens": 98
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Python",
            "label": "Text Input",
            "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.cometapi.com/v1\",\n    api_key=os.environ[\"COMETAPI_KEY\"],\n)\n\nresponse = client.responses.create(\n    model=\"gpt-6-astra\",\n    input=\"Tell me a three sentence bedtime story about a unicorn.\",\n    reasoning={\n        \"effort\": \"low\",\n    },\n)\n\nprint(response.output_text)\n"
          },
          {
            "lang": "Python",
            "label": "Image Input",
            "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.cometapi.com/v1\",\n    api_key=os.environ[\"COMETAPI_KEY\"],\n)\n\nresponse = client.responses.create(\n    model=\"gpt-6-astra\",\n    input=[\n        {\n            \"role\": \"user\",\n            \"content\": [\n                {\n                    \"type\": \"input_text\",\n                    \"text\": \"Describe the road and surrounding landscape in this image.\",\n                },\n                {\n                    \"type\": \"input_image\",\n                    \"image_url\": \"https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=1200\",\n                },\n            ],\n        },\n    ],\n    reasoning={\n        \"effort\": \"low\",\n    },\n)\n\nprint(response.output_text)\n"
          },
          {
            "lang": "Python",
            "label": "File Input",
            "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.cometapi.com/v1\",\n    api_key=os.environ[\"COMETAPI_KEY\"],\n)\n\nresponse = client.responses.create(\n    model=\"gpt-6-astra\",\n    input=[\n        {\n            \"role\": \"user\",\n            \"content\": [\n                {\n                    \"type\": \"input_text\",\n                    \"text\": \"Summarize the main topics in this shareholder letter.\",\n                },\n                {\n                    \"type\": \"input_file\",\n                    \"file_url\": \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\",\n                },\n            ],\n        },\n    ],\n    reasoning={\n        \"effort\": \"low\",\n    },\n)\n\nprint(response.output_text)\n"
          },
          {
            "lang": "Python",
            "label": "Web Search",
            "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.cometapi.com/v1\",\n    api_key=os.environ[\"COMETAPI_KEY\"],\n)\n\nresponse = client.responses.create(\n    model=\"gpt-6-astra\",\n    input=\"Search the web for the NASA Artemis II mission overview and cite the official NASA page.\",\n    tools=[\n        {\n            \"type\": \"web_search\",\n        },\n    ],\n    reasoning={\n        \"effort\": \"low\",\n    },\n)\n\nprint(response.output_text)\n"
          },
          {
            "lang": "Python",
            "label": "Streaming",
            "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.cometapi.com/v1\",\n    api_key=os.environ[\"COMETAPI_KEY\"],\n)\n\nstream = client.responses.create(\n    model=\"gpt-6-astra\",\n    input=\"Tell me a three sentence bedtime story about a unicorn.\",\n    reasoning={\n        \"effort\": \"low\",\n    },\n    stream=True,\n)\n\nfor event in stream:\n    if event.type == \"response.output_text.delta\":\n        print(event.delta, end=\"\")\n"
          },
          {
            "lang": "Python",
            "label": "Functions",
            "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.cometapi.com/v1\",\n    api_key=os.environ[\"COMETAPI_KEY\"],\n)\n\nresponse = client.responses.create(\n    model=\"gpt-6-astra\",\n    input=\"What is the weather in Boston, MA, in celsius? Use the weather tool.\",\n    tools=[\n        {\n            \"type\": \"function\",\n            \"name\": \"get_current_weather\",\n            \"description\": \"Get the current weather for a city.\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"location\": {\n                        \"type\": \"string\",\n                        \"description\": \"City and state, for example Boston, MA.\",\n                    },\n                    \"unit\": {\n                        \"type\": \"string\",\n                        \"enum\": [\n                            \"celsius\",\n                            \"fahrenheit\",\n                        ],\n                        \"description\": \"Temperature unit.\",\n                    },\n                },\n                \"required\": [\n                    \"location\",\n                    \"unit\",\n                ],\n                \"additionalProperties\": False,\n            },\n            \"strict\": True,\n        },\n    ],\n    tool_choice=\"auto\",\n    reasoning={\n        \"effort\": \"low\",\n    },\n)\n\nprint(response.output)\n"
          },
          {
            "lang": "Python",
            "label": "Reasoning",
            "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.cometapi.com/v1\",\n    api_key=os.environ[\"COMETAPI_KEY\"],\n)\n\nresponse = client.responses.create(\n    model=\"gpt-6-astra\",\n    input=\"Solve this step by step: what is 15% of 240?\",\n    reasoning={\n        \"effort\": \"high\",\n    },\n)\n\nprint(response.output_text)\n"
          },
          {
            "lang": "Python",
            "label": "Structured Output",
            "source": "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://api.cometapi.com/v1\",\n    api_key=os.environ[\"COMETAPI_KEY\"],\n)\n\nresponse = client.responses.create(\n    model=\"gpt-6-astra\",\n    input=\"List 3 programming languages with their main use cases.\",\n    text={\n        \"format\": {\n            \"type\": \"json_schema\",\n            \"name\": \"languages\",\n            \"strict\": True,\n            \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"languages\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"object\",\n                            \"properties\": {\n                                \"name\": {\n                                    \"type\": \"string\",\n                                    \"description\": \"Programming language name.\",\n                                },\n                                \"use_case\": {\n                                    \"type\": \"string\",\n                                    \"description\": \"Main use case for the language.\",\n                                },\n                            },\n                            \"required\": [\n                                \"name\",\n                                \"use_case\",\n                            ],\n                            \"additionalProperties\": False,\n                        },\n                        \"description\": \"Three programming languages and their main uses.\",\n                    },\n                },\n                \"required\": [\n                    \"languages\",\n                ],\n                \"additionalProperties\": False,\n            },\n        },\n    },\n    reasoning={\n        \"effort\": \"low\",\n    },\n)\n\nprint(response.output_text)\n"
          },
          {
            "lang": "JavaScript",
            "label": "Text Input",
            "source": "import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://api.cometapi.com/v1\",\n    apiKey: process.env.COMETAPI_KEY,\n});\n\nconst response = await client.responses.create({\n    \"model\": \"gpt-6-astra\",\n    \"input\": \"Tell me a three sentence bedtime story about a unicorn.\",\n    \"reasoning\": {\n        \"effort\": \"low\"\n    }\n});\n\nconsole.log(response.output_text);\n"
          },
          {
            "lang": "JavaScript",
            "label": "Image Input",
            "source": "import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://api.cometapi.com/v1\",\n    apiKey: process.env.COMETAPI_KEY,\n});\n\nconst response = await client.responses.create({\n    \"model\": \"gpt-6-astra\",\n    \"input\": [\n        {\n            \"role\": \"user\",\n            \"content\": [\n                {\n                    \"type\": \"input_text\",\n                    \"text\": \"Describe the road and surrounding landscape in this image.\"\n                },\n                {\n                    \"type\": \"input_image\",\n                    \"image_url\": \"https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=1200\"\n                }\n            ]\n        }\n    ],\n    \"reasoning\": {\n        \"effort\": \"low\"\n    }\n});\n\nconsole.log(response.output_text);\n"
          },
          {
            "lang": "JavaScript",
            "label": "File Input",
            "source": "import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://api.cometapi.com/v1\",\n    apiKey: process.env.COMETAPI_KEY,\n});\n\nconst response = await client.responses.create({\n    \"model\": \"gpt-6-astra\",\n    \"input\": [\n        {\n            \"role\": \"user\",\n            \"content\": [\n                {\n                    \"type\": \"input_text\",\n                    \"text\": \"Summarize the main topics in this shareholder letter.\"\n                },\n                {\n                    \"type\": \"input_file\",\n                    \"file_url\": \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\"\n                }\n            ]\n        }\n    ],\n    \"reasoning\": {\n        \"effort\": \"low\"\n    }\n});\n\nconsole.log(response.output_text);\n"
          },
          {
            "lang": "JavaScript",
            "label": "Web Search",
            "source": "import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://api.cometapi.com/v1\",\n    apiKey: process.env.COMETAPI_KEY,\n});\n\nconst response = await client.responses.create({\n    \"model\": \"gpt-6-astra\",\n    \"input\": \"Search the web for the NASA Artemis II mission overview and cite the official NASA page.\",\n    \"tools\": [\n        {\n            \"type\": \"web_search\"\n        }\n    ],\n    \"reasoning\": {\n        \"effort\": \"low\"\n    }\n});\n\nconsole.log(response.output_text);\n"
          },
          {
            "lang": "JavaScript",
            "label": "Streaming",
            "source": "import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://api.cometapi.com/v1\",\n    apiKey: process.env.COMETAPI_KEY,\n});\n\nconst stream = await client.responses.create({\n    \"model\": \"gpt-6-astra\",\n    \"input\": \"Tell me a three sentence bedtime story about a unicorn.\",\n    \"reasoning\": {\n        \"effort\": \"low\"\n    },\n    \"stream\": true\n});\n\nfor await (const event of stream) {\n    if (event.type === \"response.output_text.delta\") {\n        process.stdout.write(event.delta);\n    }\n}\n"
          },
          {
            "lang": "JavaScript",
            "label": "Functions",
            "source": "import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://api.cometapi.com/v1\",\n    apiKey: process.env.COMETAPI_KEY,\n});\n\nconst response = await client.responses.create({\n    \"model\": \"gpt-6-astra\",\n    \"input\": \"What is the weather in Boston, MA, in celsius? Use the weather tool.\",\n    \"tools\": [\n        {\n            \"type\": \"function\",\n            \"name\": \"get_current_weather\",\n            \"description\": \"Get the current weather for a city.\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"location\": {\n                        \"type\": \"string\",\n                        \"description\": \"City and state, for example Boston, MA.\"\n                    },\n                    \"unit\": {\n                        \"type\": \"string\",\n                        \"enum\": [\n                            \"celsius\",\n                            \"fahrenheit\"\n                        ],\n                        \"description\": \"Temperature unit.\"\n                    }\n                },\n                \"required\": [\n                    \"location\",\n                    \"unit\"\n                ],\n                \"additionalProperties\": false\n            },\n            \"strict\": true\n        }\n    ],\n    \"tool_choice\": \"auto\",\n    \"reasoning\": {\n        \"effort\": \"low\"\n    }\n});\n\nconsole.log(response.output);\n"
          },
          {
            "lang": "JavaScript",
            "label": "Reasoning",
            "source": "import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://api.cometapi.com/v1\",\n    apiKey: process.env.COMETAPI_KEY,\n});\n\nconst response = await client.responses.create({\n    \"model\": \"gpt-6-astra\",\n    \"input\": \"Solve this step by step: what is 15% of 240?\",\n    \"reasoning\": {\n        \"effort\": \"high\"\n    }\n});\n\nconsole.log(response.output_text);\n"
          },
          {
            "lang": "JavaScript",
            "label": "Structured Output",
            "source": "import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n    baseURL: \"https://api.cometapi.com/v1\",\n    apiKey: process.env.COMETAPI_KEY,\n});\n\nconst response = await client.responses.create({\n    \"model\": \"gpt-6-astra\",\n    \"input\": \"List 3 programming languages with their main use cases.\",\n    \"text\": {\n        \"format\": {\n            \"type\": \"json_schema\",\n            \"name\": \"languages\",\n            \"strict\": true,\n            \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"languages\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"object\",\n                            \"properties\": {\n                                \"name\": {\n                                    \"type\": \"string\",\n                                    \"description\": \"Programming language name.\"\n                                },\n                                \"use_case\": {\n                                    \"type\": \"string\",\n                                    \"description\": \"Main use case for the language.\"\n                                }\n                            },\n                            \"required\": [\n                                \"name\",\n                                \"use_case\"\n                            ],\n                            \"additionalProperties\": false\n                        },\n                        \"description\": \"Three programming languages and their main uses.\"\n                    }\n                },\n                \"required\": [\n                    \"languages\"\n                ],\n                \"additionalProperties\": false\n            }\n        }\n    },\n    \"reasoning\": {\n        \"effort\": \"low\"\n    }\n});\n\nconsole.log(response.output_text);\n"
          },
          {
            "lang": "Shell",
            "label": "Text Input",
            "source": "curl https://api.cometapi.com/v1/responses \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -d '{\n  \"model\": \"gpt-6-astra\",\n  \"input\": \"Tell me a three sentence bedtime story about a unicorn.\",\n  \"reasoning\": {\n    \"effort\": \"low\"\n  }\n}'\n"
          },
          {
            "lang": "Shell",
            "label": "Image Input",
            "source": "curl https://api.cometapi.com/v1/responses \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -d '{\n  \"model\": \"gpt-6-astra\",\n  \"input\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"input_text\",\n          \"text\": \"Describe the road and surrounding landscape in this image.\"\n        },\n        {\n          \"type\": \"input_image\",\n          \"image_url\": \"https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=1200\"\n        }\n      ]\n    }\n  ],\n  \"reasoning\": {\n    \"effort\": \"low\"\n  }\n}'\n"
          },
          {
            "lang": "Shell",
            "label": "File Input",
            "source": "curl https://api.cometapi.com/v1/responses \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -d '{\n  \"model\": \"gpt-6-astra\",\n  \"input\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"input_text\",\n          \"text\": \"Summarize the main topics in this shareholder letter.\"\n        },\n        {\n          \"type\": \"input_file\",\n          \"file_url\": \"https://www.berkshirehathaway.com/letters/2024ltr.pdf\"\n        }\n      ]\n    }\n  ],\n  \"reasoning\": {\n    \"effort\": \"low\"\n  }\n}'\n"
          },
          {
            "lang": "Shell",
            "label": "Web Search",
            "source": "curl https://api.cometapi.com/v1/responses \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -d '{\n  \"model\": \"gpt-6-astra\",\n  \"input\": \"Search the web for the NASA Artemis II mission overview and cite the official NASA page.\",\n  \"tools\": [\n    {\n      \"type\": \"web_search\"\n    }\n  ],\n  \"reasoning\": {\n    \"effort\": \"low\"\n  }\n}'\n"
          },
          {
            "lang": "Shell",
            "label": "Streaming",
            "source": "curl https://api.cometapi.com/v1/responses \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  --no-buffer \\\n  -d '{\n  \"model\": \"gpt-6-astra\",\n  \"input\": \"Tell me a three sentence bedtime story about a unicorn.\",\n  \"reasoning\": {\n    \"effort\": \"low\"\n  },\n  \"stream\": true\n}'\n"
          },
          {
            "lang": "Shell",
            "label": "Functions",
            "source": "curl https://api.cometapi.com/v1/responses \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -d '{\n  \"model\": \"gpt-6-astra\",\n  \"input\": \"What is the weather in Boston, MA, in celsius? Use the weather tool.\",\n  \"tools\": [\n    {\n      \"type\": \"function\",\n      \"name\": \"get_current_weather\",\n      \"description\": \"Get the current weather for a city.\",\n      \"parameters\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"location\": {\n            \"type\": \"string\",\n            \"description\": \"City and state, for example Boston, MA.\"\n          },\n          \"unit\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"celsius\",\n              \"fahrenheit\"\n            ],\n            \"description\": \"Temperature unit.\"\n          }\n        },\n        \"required\": [\n          \"location\",\n          \"unit\"\n        ],\n        \"additionalProperties\": false\n      },\n      \"strict\": true\n    }\n  ],\n  \"tool_choice\": \"auto\",\n  \"reasoning\": {\n    \"effort\": \"low\"\n  }\n}'\n"
          },
          {
            "lang": "Shell",
            "label": "Reasoning",
            "source": "curl https://api.cometapi.com/v1/responses \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -d '{\n  \"model\": \"gpt-6-astra\",\n  \"input\": \"Solve this step by step: what is 15% of 240?\",\n  \"reasoning\": {\n    \"effort\": \"high\"\n  }\n}'\n"
          },
          {
            "lang": "Shell",
            "label": "Structured Output",
            "source": "curl https://api.cometapi.com/v1/responses \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $COMETAPI_KEY\" \\\n  -d '{\n  \"model\": \"gpt-6-astra\",\n  \"input\": \"List 3 programming languages with their main use cases.\",\n  \"text\": {\n    \"format\": {\n      \"type\": \"json_schema\",\n      \"name\": \"languages\",\n      \"strict\": true,\n      \"schema\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"languages\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"description\": \"Programming language name.\"\n                },\n                \"use_case\": {\n                  \"type\": \"string\",\n                  \"description\": \"Main use case for the language.\"\n                }\n              },\n              \"required\": [\n                \"name\",\n                \"use_case\"\n              ],\n              \"additionalProperties\": false\n            },\n            \"description\": \"Three programming languages and their main uses.\"\n          }\n        },\n        \"required\": [\n          \"languages\"\n        ],\n        \"additionalProperties\": false\n      }\n    }\n  },\n  \"reasoning\": {\n    \"effort\": \"low\"\n  }\n}'\n"
          }
        ],
        "description": "Send text, images, files, or conversation history to a model with the Responses API."
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token authentication. Use your CometAPI key."
      }
    }
  }
}
