NinjaChat Responses API
The Responses API from NinjaChat — 1 operation(s) for responses.
The Responses API from NinjaChat — 1 operation(s) for responses.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/ninjachat-ai:ninjachat-ai-responses-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: NinjaChat Responses API
version: 1.0.0
description: Clean-break NinjaChat v1. Chat and Responses bill actual token usage; images and videos use catalog unit pricing.
servers:
- url: https://www.ninjachat.ai/api/v1
tags:
- name: Responses
paths:
/responses:
post:
summary: Create a stateless response
description: OpenAI Responses-compatible text, vision, structured-output, and function-calling API. Set stream=true for typed lifecycle events.
security:
- bearerAuth: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ResponsesRequest'
responses:
'200':
description: Completed response or SSE stream.
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseObject'
text/event-stream:
schema:
type: string
'400':
description: Invalid or unsupported request parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'402':
description: Insufficient balance or project spend limit reached.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Gateway error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
x-codeSamples:
- lang: javascript
label: TypeScript SDK
source: "import { NinjaChat } from \"@ninjachat/sdk\";\n\nconst client = new NinjaChat({ apiKey: process.env.NINJACHAT_API_KEY! });\n\nconst response = await client.responses.create({\n model: \"ninja/auto\",\n input: \"Explain the key tradeoffs in one paragraph.\",\n});\n\nconsole.log(response.output_text);"
- lang: python
label: Python SDK
source: "import os\nfrom ninjachat import NinjaChat\n\nclient = NinjaChat(api_key=os.environ[\"NINJACHAT_API_KEY\"])\n\nresponse = client.responses.create(\n model=\"ninja/auto\",\n input=\"Explain the key tradeoffs in one paragraph.\",\n)\n\nprint(response[\"output_text\"])"
x-ninjachat-status: current
tags:
- Responses
operationId: postResponses
x-operation-id-source: derived
components:
schemas:
ResponseObject:
type: object
properties:
id:
type: string
object:
type: string
enum:
- response
created_at:
type: integer
status:
type: string
enum:
- completed
- incomplete
error:
type: 'null'
incomplete_details:
type:
- object
- 'null'
properties:
reason:
type: string
enum:
- max_output_tokens
- content_filter
required:
- reason
additionalProperties: false
instructions:
type:
- string
- 'null'
max_output_tokens:
type:
- integer
- 'null'
model:
type: string
minLength: 1
maxLength: 160
output:
type: array
items:
anyOf:
- type: object
properties:
id:
type: string
type:
type: string
enum:
- reasoning
status:
type: string
enum:
- completed
- incomplete
summary:
type: array
items:
type: object
properties:
type:
type: string
enum:
- summary_text
text:
type: string
required:
- type
- text
additionalProperties: false
required:
- id
- type
- status
- summary
additionalProperties: false
- type: object
properties:
id:
type: string
type:
type: string
enum:
- message
status:
type: string
enum:
- completed
- incomplete
role:
type: string
enum:
- assistant
content:
type: array
items:
type: object
properties:
type:
type: string
enum:
- output_text
text:
type: string
annotations:
type: array
items: {}
required:
- type
- text
- annotations
additionalProperties: false
required:
- id
- type
- status
- role
- content
additionalProperties: false
- type: object
properties:
id:
type: string
type:
type: string
enum:
- function_call
status:
type: string
enum:
- completed
- incomplete
call_id:
type: string
name:
type: string
arguments:
type: string
required:
- id
- type
- status
- call_id
- name
- arguments
additionalProperties: false
output_text:
type: string
parallel_tool_calls:
type: boolean
previous_response_id:
type: 'null'
store:
type: boolean
enum:
- false
usage:
type: object
properties:
input_tokens:
type: integer
minimum: 0
input_tokens_details:
type: object
properties:
cached_tokens:
type: integer
minimum: 0
cache_creation_tokens:
type: integer
minimum: 0
required:
- cached_tokens
- cache_creation_tokens
additionalProperties: false
output_tokens:
type: integer
minimum: 0
output_tokens_details:
type: object
properties:
reasoning_tokens:
type: integer
minimum: 0
required:
- reasoning_tokens
additionalProperties: false
total_tokens:
type: integer
minimum: 0
required:
- input_tokens
- input_tokens_details
- output_tokens
- output_tokens_details
- total_tokens
additionalProperties: false
cost_usd:
type: number
minimum: 0
provider:
type:
- string
- 'null'
request_id:
type: string
routing:
$ref: '#/components/schemas/RoutingSummary'
metadata:
type: object
additionalProperties:
type: string
required:
- id
- object
- created_at
- status
- error
- incomplete_details
- instructions
- max_output_tokens
- model
- output
- output_text
- parallel_tool_calls
- previous_response_id
- store
- usage
- cost_usd
- provider
- request_id
- routing
- metadata
additionalProperties: false
ErrorResponse:
type: object
properties:
error:
type: object
properties:
message:
type: string
type:
type: string
code:
type: string
param:
type:
- string
- 'null'
required:
- message
- type
- code
additionalProperties: false
required:
- error
additionalProperties: false
RoutingPolicy:
type: object
properties:
strategy:
type: string
enum:
- balanced
- cost
- latency
- quality
providers:
type: object
properties:
only:
type: array
items:
type: string
minLength: 1
maxLength: 128
minItems: 1
maxItems: 20
exclude:
type: array
items:
type: string
minLength: 1
maxLength: 128
minItems: 1
maxItems: 20
order:
type: array
items:
type: string
minLength: 1
maxLength: 128
minItems: 1
maxItems: 20
additionalProperties: false
allow_fallbacks:
type: boolean
default: true
require_parameters:
type: boolean
default: true
data_policy:
type: string
enum:
- default
- no_training
- zero_retention
default: default
caching:
type: string
enum:
- auto
max_cost_usd:
type: number
exclusiveMinimum: 0
maximum: 1000
additionalProperties: false
ChatReasoning:
type: object
properties:
effort:
type: string
enum:
- none
- minimal
- low
- medium
- high
- xhigh
max_tokens:
type: integer
minimum: 0
maximum: 9007199254740991
enabled:
type: boolean
additionalProperties: false
ProviderAttemptReceipt:
type: object
properties:
provider:
type: string
outcome:
type: string
enum:
- served
- failed_over
- failed
attempt_index:
type: integer
minimum: 0
required:
- provider
- outcome
- attempt_index
additionalProperties: false
RoutingSummary:
type: object
properties:
strategy:
type: string
enum:
- balanced
- cost
- latency
- quality
requested_models:
type: array
items:
type: string
minLength: 1
maxLength: 160
resolved_model:
type: string
minLength: 1
maxLength: 160
provider:
type:
- string
- 'null'
provider_attempts:
type: array
items:
$ref: '#/components/schemas/ProviderAttemptReceipt'
fallbacks_allowed:
type: boolean
data_policy:
type: string
enum:
- default
- no_training
- zero_retention
caching:
type: string
enum:
- auto
source:
type: string
enum:
- request
- project
- default
router:
$ref: '#/components/schemas/RouterDecisionSummary'
required:
- strategy
- requested_models
- resolved_model
- provider
- fallbacks_allowed
- data_policy
additionalProperties: false
ResponsesRequest:
type: object
properties:
content_filter:
type: boolean
enum:
- true
description: Optional explicit acknowledgement of mandatory server-side content filtering. Only true is accepted. Filtering remains enforced when omitted; false is rejected.
model:
type: string
minLength: 1
maxLength: 160
models:
type: array
items:
type: string
minLength: 1
maxLength: 160
minItems: 1
maxItems: 15
input:
anyOf:
- type: string
minLength: 1
- type: array
items:
anyOf:
- type: object
properties:
type:
type: string
enum:
- message
role:
type: string
enum:
- developer
- system
- user
- assistant
content:
anyOf:
- type: string
minLength: 1
- type: array
items:
anyOf:
- type: object
properties:
type:
type: string
enum:
- input_text
text:
type: string
minLength: 1
required:
- type
- text
additionalProperties: false
- type: object
properties:
type:
type: string
enum:
- input_image
image_url:
type: string
minLength: 1
maxLength: 7000000
detail:
type: string
enum:
- auto
- low
- high
required:
- type
- image_url
additionalProperties: false
- type: object
properties:
type:
type: string
enum:
- input_file
filename:
type: string
minLength: 1
maxLength: 255
file_data:
type: string
minLength: 1
maxLength: 7000000
file_url:
type: string
maxLength: 4096
format: uri
media_type:
type: string
enum:
- application/pdf
- text/plain
- text/markdown
- text/csv
- application/json
required:
- type
additionalProperties: false
minItems: 1
required:
- role
- content
additionalProperties: false
- type: object
properties:
type:
type: string
enum:
- function_call
call_id:
type: string
minLength: 1
maxLength: 128
name:
type: string
minLength: 1
maxLength: 64
arguments:
type: string
required:
- type
- call_id
- name
- arguments
additionalProperties: false
- type: object
properties:
type:
type: string
enum:
- function_call_output
call_id:
type: string
minLength: 1
maxLength: 128
output:
anyOf:
- type: string
- type: array
items:
anyOf:
- type: object
properties:
type:
type: string
enum:
- input_text
text:
type: string
minLength: 1
required:
- type
- text
additionalProperties: false
- type: object
properties:
type:
type: string
enum:
- input_image
image_url:
type: string
minLength: 1
maxLength: 7000000
detail:
type: string
enum:
- auto
- low
- high
required:
- type
- image_url
additionalProperties: false
- type: object
properties:
type:
type: string
enum:
- input_file
filename:
type: string
minLength: 1
maxLength: 255
file_data:
type: string
minLength: 1
maxLength: 7000000
file_url:
type: string
maxLength: 4096
format: uri
media_type:
type: string
enum:
- application/pdf
- text/plain
- text/markdown
- text/csv
- application/json
required:
- type
additionalProperties: false
minItems: 1
required:
- type
- call_id
- output
additionalProperties: false
minItems: 1
instructions:
type: string
max_output_tokens:
type: integer
exclusiveMinimum: 0
maximum: 9007199254740991
description: Maximum completion tokens, including reasoning where the provider counts it. Must fit the selected provider's output and context limits. Defaults to 2048 when omitted.
temperature:
type: number
minimum: 0
maximum: 2
top_p:
type: number
minimum: 0
maximum: 1
stream:
type: boolean
default: false
store:
type: boolean
enum:
- false
default: false
tools:
type: array
items:
type: object
properties:
type:
type: string
enum:
- function
name:
type: string
minLength: 1
maxLength: 64
pattern: ^[a-zA-Z0-9_-]+$
description:
type: string
parameters:
type: object
additionalProperties: {}
default: {}
strict:
type: boolean
required:
- type
- name
additionalProperties: false
tool_choice:
anyOf:
- type: string
enum:
- none
- auto
- required
- type: object
properties:
type:
type: string
enum:
- function
name:
type: string
minLength: 1
maxLength: 128
required:
- type
- name
additionalProperties: false
parallel_tool_calls:
type: boolean
text:
type: object
properties:
format:
oneOf:
- type: object
properties:
type:
type: string
enum:
- text
required:
- type
additionalProperties: false
- type: object
properties:
type:
type: string
enum:
- json_object
required:
- type
additionalProperties: false
- type: object
properties:
type:
type: string
enum:
- json_schema
name:
type: string
minLength: 1
maxLength: 128
description:
type: string
schema:
type: object
additionalProperties: {}
strict:
type: boolean
default: true
required:
- type
- name
- schema
additionalProperties: false
additionalProperties: false
reasoning:
$ref: '#/components/schemas/ChatReasoning'
routing:
$ref: '#/components/schemas/RoutingPolicy'
metadata:
type: object
additionalProperties:
type: string
maxLength: 512
user:
type: string
maxLength: 256
required:
- input
additionalProperties: false
RouterDecisionSummary:
type: object
properties:
id:
type: string
enum:
- ninja/auto
task:
type: string
classified_by:
type: string
enum:
- regex
- llm
- llm-cached
override:
type:
- string
- 'null'
enum:
- long_context
- multilingual
reasoning:
type: string
candidates:
type: array
items:
type: string
minLength: 1
maxLength: 160
considered:
type: array
items:
type: object
properties: {}
required:
- id
- task
- classified_by
- override
- reasoning
- candidates
- considered
additionalProperties: false
parameters:
IdempotencyKey:
name: Idempotency-Key
in: header
required: false
schema:
type: string
minLength: 1
maxLength: 255
description: Safely retry the same logical write without duplicate billing or execution.
securitySchemes:
managementKey:
type: http
scheme: bearer
bearerFormat: nj_mk_...
description: Account-scoped management credential created by the account owner after email verification. Inference keys cannot access these endpoints; management keys cannot run inference.
anthropicApiKey:
type: apiKey
in: header
name: x-api-key
description: NinjaChat API key accepted by the Anthropic Messages compatibility endpoint.
bearerAuth:
type: http
scheme: bearer
bearerFormat: NinjaChat API key
description: Use an API key created in the NinjaChat developer console.
x-ninjachat-contract-sha256: df530775ec7be5779917a6c4c5b6015b760809e62fd002827541bf6cac66310e