メイン コンテンツにスキップ

このブラウザーはサポートされなくなりました。

Microsoft Edge にアップグレードすると、最新の機能、セキュリティ更新プログラム、およびテクニカル サポートを利用できます。

Microsoft Edge をダウンロードする Internet Explorer と Microsoft Edge の詳細情報
microsoft-foundry.rest.security.o-auth2-auth

Models

Get a model

GET /openai/v1/models/{model}

Retrieves a model by its identifier.

パス パラメーター

model string 必須

The ID of the model to use for this request

応答

The request has succeeded.

本文

Content-Type: application/json
id string 必須

The model identifier, which can be referenced in the API endpoints.

created integer 必須

The Unix timestamp (in seconds) when the model was created.

object enum 必須

The object type, which is always "model".

model
owned_by string 必須

The organization that owns the model.

shutdown_date string | null

The date when the model will shut down, or null if not announced.

Client error

本文

Content-Type: application/json
error OpenAI.Error 必須
code string | null 必須
message string 必須
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
次のいずれか:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string 必須

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

本文

Content-Type: application/json
error OpenAI.Error 必須
code string | null 必須
message string 必須
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
次のいずれか:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string 必須

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

要求

curl https://api.openai.com/v1/models/VAR_chat_model_id \
  -H "Authorization: Bearer $OPENAI_API_KEY"
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
model = client.models.retrieve(
    "gpt-4o-mini",
)
print(model.id)
import OpenAI from "openai";

const openai = new OpenAI();

async function main() {
  const model = await openai.models.retrieve("VAR_chat_model_id");

  console.log(model);
}

main();
using System;
using System.ClientModel;

using OpenAI.Models;

  OpenAIModelClient client = new(
    apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
);

ClientResult<OpenAIModel> model = client.GetModel("babbage-002");
Console.WriteLine(model.Value.Id);
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const model = await client.models.retrieve('gpt-4o-mini');

console.log(model.id);
package main

import (
    "context"
    "fmt"

    "github.com/openai/openai-go"
    "github.com/openai/openai-go/option"
)

func main() {
    client := openai.NewClient(
        option.WithAPIKey("My API Key"),
    )
    model, err := client.Models.Get(context.TODO(), "gpt-4o-mini")
    if err != nil {
        panic(err.Error())
    }
    fmt.Printf("%+v
", model.ID)
}
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.models.Model;
import com.openai.models.models.ModelRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        Model model = client.models().retrieve("gpt-4o-mini");
    }
}
require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

model = openai.models.retrieve("gpt-4o-mini")

puts(model)

回答

{
  "id": "VAR_chat_model_id",
  "object": "model",
  "created": 1686935002,
  "owned_by": "openai"
}
ja-jp
プライバシーの選択
  • AI 免責事項
  • 以前のバージョン
  • ブログ
  • 投稿
  • プライバシー
  • コンシューマーの健康に関するプライバシー
  • 利用条件
  • 商標
  • © Microsoft 2026