Skip to content
Skip to Content
Coder Docs

Create an AI model in an organization

POST
/api/v2/organizations/{organization}/chats/models

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

organization*string

Organization name or ID

Request Body

Model

application/json
  1. body
ai_provider_id?string
Formatuuid
compression_threshold?integer
context_limit?integer
display_name?string
enabled?boolean
is_default?boolean
model?string
model_config?

Response Body

Created

application/json
  1. response
ai_provider_id?string
Formatuuid
compression_threshold?integer
context_limit?integer
created_at?string
Formatdate-time
display_name?string
enabled?boolean
id?string
Formatuuid
is_default?boolean
model?string
model_config?
organization_id?string
Formatuuid
reasoning_efforts?array<string>

ReasoningEfforts lists selectable reasoning effort values through the model's configured maximum.

updated_at?string
Formatdate-time

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X POST \	"$CODER_URL/api/v2/organizations/{organization}/chats/models" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "ai_provider_id": "5a3b8ff9-20e7-4c37-ba1a-5b433e355819",  "compression_threshold": 0,  "context_limit": 0}'
Example Response201
{  "ai_provider_id": "5a3b8ff9-20e7-4c37-ba1a-5b433e355819",  "compression_threshold": 0,  "context_limit": 0,  "created_at": "2019-08-24T14:15:22Z",  "display_name": "string",  "enabled": true,  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "is_default": true,  "model": "string",  "model_config": {    "frequency_penalty": 0,    "max_output_tokens": 0,    "openai_config": {      "reasoning_model": true,      "use_responses_api": true    },    "presence_penalty": 0,    "provider_options": {      "anthropic": {        "allowed_domains": [          "string"        ],        "blocked_domains": [          "string"        ],        "context_1m_enabled": true,        "disable_parallel_tool_use": true,        "send_reasoning": true,        "thinking": {          "budget_tokens": 0        },        "thinking_display": "string",        "web_search_enabled": true      },      "google": {        "cached_content": "string",        "safety_settings": [          {            "category": "string",            "threshold": "string"          }        ],        "thinking_config": {          "include_thoughts": true,          "thinking_budget": 0,          "thinking_level": "string"        },        "threshold": "string",        "web_search_enabled": true      },      "openai": {        "allowed_domains": [          "string"        ],        "include": [          "string"        ],        "instructions": "string",        "log_probs": true,        "logit_bias": {          "property1": 0,          "property2": 0        },        "max_completion_tokens": 0,        "max_tool_calls": 0,        "metadata": {          "property1": null,          "property2": null        },        "parallel_tool_calls": true,        "prediction": {          "property1": null,          "property2": null        },        "prompt_cache_key": "string",        "reasoning_mode": "string",        "reasoning_summary": "string",        "safety_identifier": "string",        "search_context_size": "string",        "service_tier": "string",        "store": true,        "strict_json_schema": true,        "structured_outputs": true,        "text_verbosity": "string",        "top_log_probs": 0,        "user": "string",        "web_search_enabled": true      },      "openaicompat": {        "user": "string"      },      "openrouter": {        "extra_body": {          "property1": null,          "property2": null        },        "include_usage": true,        "log_probs": true,        "logit_bias": {          "property1": 0,          "property2": 0        },        "parallel_tool_calls": true,        "provider": {          "allow_fallbacks": true,          "data_collection": "string",          "ignore": [            "string"          ],          "only": [            "string"          ],          "order": [            "string"          ],          "quantizations": [            "string"          ],          "require_parameters": true,          "sort": "string"        },        "reasoning": {          "enabled": true,          "exclude": true,          "max_tokens": 0        },        "user": "string"      },      "vercel": {        "extra_body": {          "property1": null,          "property2": null        },        "logit_bias": {          "property1": 0,          "property2": 0        },        "logprobs": true,        "parallel_tool_calls": true,        "providerOptions": {          "models": [            "string"          ],          "order": [            "string"          ]        },        "reasoning": {          "enabled": true,          "exclude": true,          "max_tokens": 0        },        "top_logprobs": 0,        "user": "string"      }    },    "reasoning_effort": {      "default": "string",      "max": "string"    },    "temperature": 0,    "top_k": 0,    "top_p": 0  },  "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",  "reasoning_efforts": [    "string"  ],  "updated_at": "2019-08-24T14:15:22Z"}